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.cuba;
|
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.excel.common.ExcelImportState;
|
19
|
import eu.etaxonomy.cdm.io.excel.common.ExcelRowBase;
|
20
|
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
|
21
|
import eu.etaxonomy.cdm.model.name.IBotanicalName;
|
22
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
23
|
import eu.etaxonomy.cdm.model.taxon.Classification;
|
24
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
25
|
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
26
|
|
27
|
/**
|
28
|
* @author a.mueller
|
29
|
* @since 11.05.2009
|
30
|
*/
|
31
|
public class CubaImportState extends ExcelImportState<CubaImportConfigurator, ExcelRowBase>{
|
32
|
@SuppressWarnings("unused")
|
33
|
private static final Logger logger = Logger.getLogger(CubaImportState.class);
|
34
|
|
35
|
private final Map<String, Taxon> higherTaxonTaxonMap = new HashMap<>();
|
36
|
|
37
|
private final Map<String, UUID> higherTaxonUuidMap = new HashMap<>();
|
38
|
|
39
|
private final Map<String, IBotanicalName> familyNameMap = new HashMap<>();
|
40
|
|
41
|
//classification
|
42
|
private Classification classification;
|
43
|
public Classification getClassification() {return classification;}
|
44
|
public void setClassification(Classification classification) {this.classification = classification;}
|
45
|
|
46
|
//current taxon
|
47
|
private Taxon currentTaxon;
|
48
|
public Taxon getCurrentTaxon() {return currentTaxon;}
|
49
|
public void setCurrentTaxon(Taxon currentTaxon) {this.currentTaxon = currentTaxon;}
|
50
|
|
51
|
//rootNode
|
52
|
private TaxonNode rootNode;
|
53
|
public void setRootNode(TaxonNode rootNode) {this.rootNode = rootNode;}
|
54
|
public TaxonNode getRootNode() { return rootNode;}
|
55
|
|
56
|
private Reference secReference;
|
57
|
public Reference getSecReference() {return secReference;}
|
58
|
public void setSecReference(Reference secReference) {this.secReference = secReference;}
|
59
|
|
60
|
private PresenceAbsenceTerm highestStatusForTaxon;
|
61
|
public PresenceAbsenceTerm getHighestStatusForTaxon(){return highestStatusForTaxon;}
|
62
|
public void setHighestStatusForTaxon(PresenceAbsenceTerm highestStatusForTaxon){this.highestStatusForTaxon = highestStatusForTaxon;}
|
63
|
|
64
|
private boolean isCubanProvince;
|
65
|
public void setCubanProvince(boolean cubanProvince) {this.isCubanProvince = cubanProvince;}
|
66
|
public boolean isCubanProvince(){return isCubanProvince;}
|
67
|
|
68
|
private boolean taxonIsAbsent = false;
|
69
|
public boolean isTaxonIsAbsent(){return this.taxonIsAbsent;}
|
70
|
public void setTaxonIsAbsent(boolean taxonIsAbsent) {this.taxonIsAbsent = taxonIsAbsent;}
|
71
|
|
72
|
private boolean isEndemic = false;
|
73
|
public boolean isEndemic(){return this.isEndemic;}
|
74
|
public void setEndemic(boolean isEndemic) {this.isEndemic = isEndemic;}
|
75
|
|
76
|
//Constructor
|
77
|
public CubaImportState(CubaImportConfigurator config) {
|
78
|
super(config);
|
79
|
}
|
80
|
|
81
|
|
82
|
//higher taxon
|
83
|
public Taxon getHigherTaxon(String higherName) {
|
84
|
return higherTaxonTaxonMap.get(higherName);
|
85
|
}
|
86
|
public Taxon putHigherTaxon(String higherName, Taxon taxon) {
|
87
|
return higherTaxonTaxonMap.put(higherName, taxon);
|
88
|
}
|
89
|
public Taxon removeHigherTaxon(String higherName) {
|
90
|
return higherTaxonTaxonMap.remove(higherName);
|
91
|
}
|
92
|
public boolean containsHigherTaxon(String higherName) {
|
93
|
return higherTaxonTaxonMap.containsKey(higherName);
|
94
|
}
|
95
|
|
96
|
//higher taxon uuid
|
97
|
public UUID getHigherTaxonUuid(String higherName) {
|
98
|
return higherTaxonUuidMap.get(higherName);
|
99
|
}
|
100
|
public UUID putHigherTaxon(String higherName, UUID uuid) {
|
101
|
return higherTaxonUuidMap.put(higherName, uuid);
|
102
|
}
|
103
|
public UUID removeHigherTaxonUuid(String higherName) {
|
104
|
return higherTaxonUuidMap.remove(higherName);
|
105
|
}
|
106
|
public boolean containsHigherTaxonUuid(String higherName) {
|
107
|
return higherTaxonUuidMap.containsKey(higherName);
|
108
|
}
|
109
|
|
110
|
//family names
|
111
|
public IBotanicalName getFamilyName(String familyStr) {
|
112
|
return familyNameMap.get(familyStr);
|
113
|
}
|
114
|
public void putFamilyName(String familyStr, IBotanicalName name) {
|
115
|
familyNameMap.put(familyStr, name);
|
116
|
}
|
117
|
|
118
|
|
119
|
Map<UUID, Reference> refMap = new HashMap<>();
|
120
|
//reference
|
121
|
public Reference getReference(UUID uuidRef) {
|
122
|
return refMap.get(uuidRef);
|
123
|
}
|
124
|
public void putReference(UUID uuidRef, Reference ref) {
|
125
|
refMap.put(uuidRef, ref);
|
126
|
}
|
127
|
|
128
|
|
129
|
|
130
|
|
131
|
}
|