3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.cdm
.io
.cuba
;
13 import java
.util
.HashMap
;
15 import java
.util
.UUID
;
17 import org
.apache
.log4j
.Logger
;
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
;
32 public class CubaImportState
extends ExcelImportState
<CubaImportConfigurator
, ExcelRowBase
>{
33 @SuppressWarnings("unused")
34 private static final Logger logger
= Logger
.getLogger(CubaImportState
.class);
36 private final Map
<String
, Taxon
> higherTaxonTaxonMap
= new HashMap
<String
, Taxon
>();
38 private final Map
<String
, UUID
> higherTaxonUuidMap
= new HashMap
<String
, UUID
>();
40 private final Map
<String
, BotanicalName
> familyNameMap
= new HashMap
<String
, BotanicalName
>();
43 private Classification classification
;
44 public Classification
getClassification() {return classification
;}
45 public void setClassification(Classification classification
) {this.classification
= classification
;}
48 private Taxon currentTaxon
;
49 public Taxon
getCurrentTaxon() {return currentTaxon
;}
50 public void setCurrentTaxon(Taxon currentTaxon
) {this.currentTaxon
= currentTaxon
;}
53 private TaxonNode rootNode
;
54 public void setRootNode(TaxonNode rootNode
) {this.rootNode
= rootNode
;}
55 public TaxonNode
getRootNode() { return rootNode
;}
57 private Reference
<?
> secReference
;
58 public Reference
<?
> getSecReference() {return secReference
;}
59 public void setSecReference(Reference
<?
> secReference
) {this.secReference
= secReference
;}
61 private PresenceAbsenceTerm highestStatusForTaxon
;
62 public PresenceAbsenceTerm
getHighestStatusForTaxon(){return highestStatusForTaxon
;}
63 public void setHighestStatusForTaxon(PresenceAbsenceTerm highestStatusForTaxon
){this.highestStatusForTaxon
= highestStatusForTaxon
;}
65 private boolean isCubanProvince
;
66 public void setCubanProvince(boolean cubanProvince
) {this.isCubanProvince
= cubanProvince
;}
67 public boolean isCubanProvince(){return isCubanProvince
;}
69 private boolean taxonIsAbsent
= false;
70 public boolean isTaxonIsAbsent(){return this.taxonIsAbsent
;}
71 public void setTaxonIsAbsent(boolean taxonIsAbsent
) {this.taxonIsAbsent
= taxonIsAbsent
;}
73 private boolean isEndemic
= false;
74 public boolean isEndemic(){return this.isEndemic
;}
75 public void setEndemic(boolean isEndemic
) {this.isEndemic
= isEndemic
;}
78 public CubaImportState(CubaImportConfigurator config
) {
84 public Taxon
getHigherTaxon(String higherName
) {
85 return higherTaxonTaxonMap
.get(higherName
);
87 public Taxon
putHigherTaxon(String higherName
, Taxon taxon
) {
88 return higherTaxonTaxonMap
.put(higherName
, taxon
);
90 public Taxon
removeHigherTaxon(String higherName
) {
91 return higherTaxonTaxonMap
.remove(higherName
);
93 public boolean containsHigherTaxon(String higherName
) {
94 return higherTaxonTaxonMap
.containsKey(higherName
);
98 public UUID
getHigherTaxonUuid(String higherName
) {
99 return higherTaxonUuidMap
.get(higherName
);
101 public UUID
putHigherTaxon(String higherName
, UUID uuid
) {
102 return higherTaxonUuidMap
.put(higherName
, uuid
);
104 public UUID
removeHigherTaxonUuid(String higherName
) {
105 return higherTaxonUuidMap
.remove(higherName
);
107 public boolean containsHigherTaxonUuid(String higherName
) {
108 return higherTaxonUuidMap
.containsKey(higherName
);
112 public BotanicalName
getFamilyName(String familyStr
) {
113 return familyNameMap
.get(familyStr
);
115 public void putFamilyName(String familyStr
, BotanicalName name
) {
116 familyNameMap
.put(familyStr
, name
);
120 Map
<UUID
, Reference
<?
>> refMap
= new HashMap
<UUID
, Reference
<?
>>();
122 public Reference
<?
> getReference(UUID uuidRef
) {
123 return refMap
.get(uuidRef
);
125 public void putReference(UUID uuidRef
, Reference
<?
> ref
) {
126 refMap
.put(uuidRef
, ref
);