Project

General

Profile

Download (3.92 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.iapt;
11

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

    
16
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState;
17
import org.apache.log4j.Logger;
18

    
19
import eu.etaxonomy.cdm.io.excel.common.ExcelImportState;
20
import eu.etaxonomy.cdm.io.excel.common.ExcelRowBase;
21
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
22
import eu.etaxonomy.cdm.model.name.BotanicalName;
23
import eu.etaxonomy.cdm.model.reference.Reference;
24
import eu.etaxonomy.cdm.model.taxon.Classification;
25
import eu.etaxonomy.cdm.model.taxon.Taxon;
26
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
27

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

    
36
	private final Map<String, Taxon> higherTaxonTaxonMap = new HashMap<String, Taxon>();
37

    
38
	private final Map<String, UUID> higherTaxonUuidMap = new HashMap<String, UUID>();
39

    
40
    private final Map<String, Taxon> genusTaxonMap = new HashMap<String, Taxon>();
41

    
42
	private final Map<String, BotanicalName> familyNameMap = new HashMap<String, BotanicalName>();
43

    
44
	//classification
45
	private Classification classification;
46
    public Classification getClassification() {return classification;}
47
    public void setClassification(Classification classification) {this.classification = classification;}
48

    
49
    //current taxon
50
    private Taxon currentTaxon;
51
    public Taxon getCurrentTaxon() {return currentTaxon;}
52
    public void setCurrentTaxon(Taxon currentTaxon) {this.currentTaxon = currentTaxon;}
53

    
54
    //rootNode
55
    private TaxonNode rootNode;
56
    public void setRootNode(TaxonNode rootNode) {this.rootNode = rootNode;}
57
    public TaxonNode getRootNode() { return rootNode;}
58

    
59
    private Reference secReference;
60
    public Reference getSecReference() {return secReference;}
61
    public void setSecReference(Reference secReference) {this.secReference = secReference;}
62

    
63
    private PresenceAbsenceTerm highestStatusForTaxon;
64
    public PresenceAbsenceTerm getHighestStatusForTaxon(){return highestStatusForTaxon;}
65
    public void setHighestStatusForTaxon(PresenceAbsenceTerm highestStatusForTaxon){this.highestStatusForTaxon = highestStatusForTaxon;}
66

    
67
    //Constructor
68
    public IAPTImportState(IAPTImportConfigurator config) {
69
		super(config);
70
	}
71

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

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

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

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

    
113

    
114
}
(3-3/5)