1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.cdm.io.iapt;
|
12
|
|
13
|
import java.util.HashMap;
|
14
|
import java.util.Map;
|
15
|
import java.util.UUID;
|
16
|
|
17
|
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState;
|
18
|
import org.apache.log4j.Logger;
|
19
|
|
20
|
import eu.etaxonomy.cdm.io.excel.common.ExcelImportState;
|
21
|
import eu.etaxonomy.cdm.io.excel.common.ExcelRowBase;
|
22
|
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
|
23
|
import eu.etaxonomy.cdm.model.name.BotanicalName;
|
24
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
25
|
import eu.etaxonomy.cdm.model.taxon.Classification;
|
26
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
27
|
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
28
|
|
29
|
/**
|
30
|
* @author a.mueller
|
31
|
* @created 11.05.2009
|
32
|
*/
|
33
|
public class IAPTImportState extends SimpleExcelTaxonImportState<IAPTImportConfigurator> {
|
34
|
@SuppressWarnings("unused")
|
35
|
private static final Logger logger = Logger.getLogger(IAPTImportState.class);
|
36
|
|
37
|
private final Map<String, Taxon> higherTaxonTaxonMap = new HashMap<String, Taxon>();
|
38
|
|
39
|
private final Map<String, UUID> higherTaxonUuidMap = new HashMap<String, UUID>();
|
40
|
|
41
|
private final Map<String, BotanicalName> familyNameMap = new HashMap<String, BotanicalName>();
|
42
|
|
43
|
//classification
|
44
|
private Classification classification;
|
45
|
public Classification getClassification() {return classification;}
|
46
|
public void setClassification(Classification classification) {this.classification = classification;}
|
47
|
|
48
|
//current taxon
|
49
|
private Taxon currentTaxon;
|
50
|
public Taxon getCurrentTaxon() {return currentTaxon;}
|
51
|
public void setCurrentTaxon(Taxon currentTaxon) {this.currentTaxon = currentTaxon;}
|
52
|
|
53
|
//rootNode
|
54
|
private TaxonNode rootNode;
|
55
|
public void setRootNode(TaxonNode rootNode) {this.rootNode = rootNode;}
|
56
|
public TaxonNode getRootNode() { return rootNode;}
|
57
|
|
58
|
private Reference secReference;
|
59
|
public Reference getSecReference() {return secReference;}
|
60
|
public void setSecReference(Reference secReference) {this.secReference = secReference;}
|
61
|
|
62
|
private PresenceAbsenceTerm highestStatusForTaxon;
|
63
|
public PresenceAbsenceTerm getHighestStatusForTaxon(){return highestStatusForTaxon;}
|
64
|
public void setHighestStatusForTaxon(PresenceAbsenceTerm highestStatusForTaxon){this.highestStatusForTaxon = highestStatusForTaxon;}
|
65
|
|
66
|
//Constructor
|
67
|
public IAPTImportState(IAPTImportConfigurator config) {
|
68
|
super(config);
|
69
|
}
|
70
|
|
71
|
//higher taxon
|
72
|
public Taxon getHigherTaxon(String higherName) {
|
73
|
return higherTaxonTaxonMap.get(higherName);
|
74
|
}
|
75
|
public Taxon putHigherTaxon(String higherName, Taxon taxon) {
|
76
|
return higherTaxonTaxonMap.put(higherName, taxon);
|
77
|
}
|
78
|
public Taxon removeHigherTaxon(String higherName) {
|
79
|
return higherTaxonTaxonMap.remove(higherName);
|
80
|
}
|
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
|
//family names
|
100
|
public BotanicalName getFamilyName(String familyStr) {
|
101
|
return familyNameMap.get(familyStr);
|
102
|
}
|
103
|
public void putFamilyName(String familyStr, BotanicalName name) {
|
104
|
familyNameMap.put(familyStr, name);
|
105
|
}
|
106
|
|
107
|
|
108
|
Map<UUID, Reference> refMap = new HashMap<UUID, Reference>();
|
109
|
//reference
|
110
|
public Reference getReference(UUID uuidRef) {
|
111
|
return refMap.get(uuidRef);
|
112
|
}
|
113
|
public void putReference(UUID uuidRef, Reference ref) {
|
114
|
refMap.put(uuidRef, ref);
|
115
|
}
|
116
|
|
117
|
|
118
|
}
|