Revert missing rank constant
[cdmlib-apps.git] / app-import / src / main / java / eu / etaxonomy / cdm / io / cuba / CubaImportState.java
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.cuba;
12
13 import java.util.HashMap;
14 import java.util.Map;
15 import java.util.UUID;
16
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 CubaImportState extends ExcelImportState<CubaImportConfigurator, ExcelRowBase>{
33 @SuppressWarnings("unused")
34 private static final Logger logger = Logger.getLogger(CubaImportState.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, BotanicalName> familyNameMap = new HashMap<String, BotanicalName>();
41
42 //classification
43 private Classification classification;
44 public Classification getClassification() {return classification;}
45 public void setClassification(Classification classification) {this.classification = classification;}
46
47 //current taxon
48 private Taxon currentTaxon;
49 public Taxon getCurrentTaxon() {return currentTaxon;}
50 public void setCurrentTaxon(Taxon currentTaxon) {this.currentTaxon = currentTaxon;}
51
52 //rootNode
53 private TaxonNode rootNode;
54 public void setRootNode(TaxonNode rootNode) {this.rootNode = rootNode;}
55 public TaxonNode getRootNode() { return rootNode;}
56
57 private Reference<?> secReference;
58 public Reference<?> getSecReference() {return secReference;}
59 public void setSecReference(Reference<?> secReference) {this.secReference = secReference;}
60
61 private PresenceAbsenceTerm highestStatusForTaxon;
62 public PresenceAbsenceTerm getHighestStatusForTaxon(){return highestStatusForTaxon;}
63 public void setHighestStatusForTaxon(PresenceAbsenceTerm highestStatusForTaxon){this.highestStatusForTaxon = highestStatusForTaxon;}
64
65 private boolean isCubanProvince;
66 public void setCubanProvince(boolean cubanProvince) {this.isCubanProvince = cubanProvince;}
67 public boolean isCubanProvince(){return isCubanProvince;}
68
69 private boolean taxonIsAbsent = false;
70 public boolean isTaxonIsAbsent(){return this.taxonIsAbsent;}
71 public void setTaxonIsAbsent(boolean taxonIsAbsent) {this.taxonIsAbsent = taxonIsAbsent;}
72
73 private boolean isEndemic = false;
74 public boolean isEndemic(){return this.isEndemic;}
75 public void setEndemic(boolean isEndemic) {this.isEndemic = isEndemic;}
76
77 //Constructor
78 public CubaImportState(CubaImportConfigurator config) {
79 super(config);
80 }
81
82
83 //higher taxon
84 public Taxon getHigherTaxon(String higherName) {
85 return higherTaxonTaxonMap.get(higherName);
86 }
87 public Taxon putHigherTaxon(String higherName, Taxon taxon) {
88 return higherTaxonTaxonMap.put(higherName, taxon);
89 }
90 public Taxon removeHigherTaxon(String higherName) {
91 return higherTaxonTaxonMap.remove(higherName);
92 }
93 public boolean containsHigherTaxon(String higherName) {
94 return higherTaxonTaxonMap.containsKey(higherName);
95 }
96
97 //higher taxon uuid
98 public UUID getHigherTaxonUuid(String higherName) {
99 return higherTaxonUuidMap.get(higherName);
100 }
101 public UUID putHigherTaxon(String higherName, UUID uuid) {
102 return higherTaxonUuidMap.put(higherName, uuid);
103 }
104 public UUID removeHigherTaxonUuid(String higherName) {
105 return higherTaxonUuidMap.remove(higherName);
106 }
107 public boolean containsHigherTaxonUuid(String higherName) {
108 return higherTaxonUuidMap.containsKey(higherName);
109 }
110
111 //family names
112 public BotanicalName getFamilyName(String familyStr) {
113 return familyNameMap.get(familyStr);
114 }
115 public void putFamilyName(String familyStr, BotanicalName name) {
116 familyNameMap.put(familyStr, name);
117 }
118
119
120 Map<UUID, Reference<?>> refMap = new HashMap<UUID, Reference<?>>();
121 //reference
122 public Reference<?> getReference(UUID uuidRef) {
123 return refMap.get(uuidRef);
124 }
125 public void putReference(UUID uuidRef, Reference<?> ref) {
126 refMap.put(uuidRef, ref);
127 }
128
129
130
131
132 }