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
>();
45 private Classification classification
;
46 public Classification
getClassification() {return classification
;}
47 public void setClassification(Classification classification
) {this.classification
= classification
;}
50 private Taxon currentTaxon
;
51 public Taxon
getCurrentTaxon() {return currentTaxon
;}
52 public void setCurrentTaxon(Taxon currentTaxon
) {this.currentTaxon
= currentTaxon
;}
55 private TaxonNode rootNode
;
56 public void setRootNode(TaxonNode rootNode
) {this.rootNode
= rootNode
;}
57 public TaxonNode
getRootNode() { return rootNode
;}
59 private Reference
<?
> secReference
;
60 public Reference
<?
> getSecReference() {return secReference
;}
61 public void setSecReference(Reference
<?
> secReference
) {this.secReference
= secReference
;}
63 private PresenceAbsenceTerm highestStatusForTaxon
;
64 public PresenceAbsenceTerm
getHighestStatusForTaxon(){return highestStatusForTaxon
;}
65 public void setHighestStatusForTaxon(PresenceAbsenceTerm highestStatusForTaxon
){this.highestStatusForTaxon
= highestStatusForTaxon
;}
67 private boolean isCubanProvince
;
68 public void setCubanProvince(boolean cubanProvince
) {this.isCubanProvince
= cubanProvince
;}
69 public boolean isCubanProvince(){return isCubanProvince
;}
72 public CubaImportState(CubaImportConfigurator config
) {
78 public Taxon
getHigherTaxon(String higherName
) {
79 return higherTaxonTaxonMap
.get(higherName
);
81 public Taxon
putHigherTaxon(String higherName
, Taxon taxon
) {
82 return higherTaxonTaxonMap
.put(higherName
, taxon
);
84 public Taxon
removeHigherTaxon(String higherName
) {
85 return higherTaxonTaxonMap
.remove(higherName
);
87 public boolean containsHigherTaxon(String higherName
) {
88 return higherTaxonTaxonMap
.containsKey(higherName
);
92 public UUID
getHigherTaxonUuid(String higherName
) {
93 return higherTaxonUuidMap
.get(higherName
);
95 public UUID
putHigherTaxon(String higherName
, UUID uuid
) {
96 return higherTaxonUuidMap
.put(higherName
, uuid
);
98 public UUID
removeHigherTaxonUuid(String higherName
) {
99 return higherTaxonUuidMap
.remove(higherName
);
101 public boolean containsHigherTaxonUuid(String higherName
) {
102 return higherTaxonUuidMap
.containsKey(higherName
);
106 public BotanicalName
getFamilyName(String familyStr
) {
107 return familyNameMap
.get(familyStr
);
109 public void putFamilyName(String familyStr
, BotanicalName name
) {
110 familyNameMap
.put(familyStr
, name
);
114 Map
<UUID
, Reference
<?
>> refMap
= new HashMap
<UUID
, Reference
<?
>>();
116 public Reference
<?
> getReference(UUID uuidRef
) {
117 return refMap
.get(uuidRef
);
119 public void putReference(UUID uuidRef
, Reference
<?
> ref
) {
120 refMap
.put(uuidRef
, ref
);