Project

General

Profile

Download (3.68 KB) Statistics
| Branch: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.io.phycobank;
11

    
12
import java.util.HashMap;
13
import java.util.Map;
14
import java.util.UUID;
15

    
16
import org.apache.log4j.Logger;
17

    
18
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState;
19
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
20
import eu.etaxonomy.cdm.model.reference.Reference;
21
import eu.etaxonomy.cdm.model.taxon.Classification;
22
import eu.etaxonomy.cdm.model.taxon.Taxon;
23
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
24

    
25
/**
26
 * @author a.mueller
27
 * @since 11.05.2009
28
 */
29
public class IAPTImportState extends SimpleExcelTaxonImportState<IAPTImportConfigurator> {
30
	@SuppressWarnings("unused")
31
	private static final Logger logger = Logger.getLogger(IAPTImportState.class);
32

    
33
	private final Map<String, Taxon> higherTaxonTaxonMap = new HashMap<>();
34

    
35
	private final Map<String, UUID> higherTaxonUuidMap = new HashMap<>();
36

    
37
    private final Map<String, Taxon> genusTaxonMap = new HashMap<>();
38

    
39
	//classification
40
	private Classification classification;
41
    public Classification getClassification() {return classification;}
42
    public void setClassification(Classification classification) {this.classification = classification;}
43

    
44
    //current taxon
45
    private Taxon currentTaxon;
46
    public Taxon getCurrentTaxon() {return currentTaxon;}
47
    public void setCurrentTaxon(Taxon currentTaxon) {this.currentTaxon = currentTaxon;}
48

    
49
    //rootNode
50
    private TaxonNode rootNode;
51
    public void setRootNode(TaxonNode rootNode) {this.rootNode = rootNode;}
52
    public TaxonNode getRootNode() { return rootNode;}
53

    
54
    private Reference secReference;
55
    public Reference getSecReference() {return secReference;}
56
    public void setSecReference(Reference secReference) {this.secReference = secReference;}
57

    
58
    private PresenceAbsenceTerm highestStatusForTaxon;
59
    public PresenceAbsenceTerm getHighestStatusForTaxon(){return highestStatusForTaxon;}
60
    public void setHighestStatusForTaxon(PresenceAbsenceTerm highestStatusForTaxon){this.highestStatusForTaxon = highestStatusForTaxon;}
61

    
62
    //Constructor
63
    public IAPTImportState(IAPTImportConfigurator config) {
64
		super(config);
65
	}
66

    
67
    //higher taxon
68
    @Override
69
    public Taxon getHigherTaxon(String higherName) {
70
        return higherTaxonTaxonMap.get(higherName);
71
    }
72
	@Override
73
    public Taxon putHigherTaxon(String higherName, Taxon taxon) {
74
		return higherTaxonTaxonMap.put(higherName, taxon);
75
	}
76
	@Override
77
    public Taxon removeHigherTaxon(String higherName) {
78
		return higherTaxonTaxonMap.remove(higherName);
79
	}
80
    @Override
81
    public boolean containsHigherTaxon(String higherName) {
82
        return higherTaxonTaxonMap.containsKey(higherName);
83
    }
84

    
85
    //higher taxon uuid
86
    public UUID getHigherTaxonUuid(String higherName) {
87
        return higherTaxonUuidMap.get(higherName);
88
    }
89
	public UUID putHigherTaxon(String higherName, UUID uuid) {
90
		return higherTaxonUuidMap.put(higherName, uuid);
91
	}
92
	public UUID removeHigherTaxonUuid(String higherName) {
93
		return higherTaxonUuidMap.remove(higherName);
94
	}
95
    public boolean containsHigherTaxonUuid(String higherName) {
96
        return higherTaxonUuidMap.containsKey(higherName);
97
    }
98

    
99
    public Map<String, Taxon> getGenusTaxonMap() {
100
        return genusTaxonMap;
101
    }
102

    
103
    Map<UUID, Reference> refMap = new HashMap<UUID, Reference>();
104
    //reference
105
    public Reference getReference(UUID uuidRef) {
106
        return refMap.get(uuidRef);
107
    }
108
    public void putReference(UUID uuidRef, Reference ref) {
109
        refMap.put(uuidRef, ref);
110
    }
111

    
112

    
113
}
(3-3/8)