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.eflora.centralAfrica.checklist;
|
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.common.DbImportStateBase;
|
19
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
20
|
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
|
21
|
|
22
|
/**
|
23
|
* @author a.mueller
|
24
|
* @since 11.05.2009
|
25
|
*/
|
26
|
public class CentralAfricaChecklistImportState extends DbImportStateBase<CentralAfricaChecklistImportConfigurator, CentralAfricaChecklistImportState>{
|
27
|
@SuppressWarnings("unused")
|
28
|
private static final Logger logger = Logger.getLogger(CentralAfricaChecklistImportState.class);
|
29
|
|
30
|
private Map<String, DefinedTermBase> dbCdmDefTermMap = new HashMap<String, DefinedTermBase>();
|
31
|
|
32
|
private String lastFamily;
|
33
|
private String lastGenus;
|
34
|
private Map<String, UUID> higherTaxonUuidMap = new HashMap<String, UUID>();
|
35
|
|
36
|
private Reference genevaReference;
|
37
|
|
38
|
|
39
|
public boolean containsHigherTaxon(String higherName) {
|
40
|
return higherTaxonUuidMap.containsKey(higherName);
|
41
|
}
|
42
|
|
43
|
public UUID putHigherTaxon(String higherName, UUID uuid) {
|
44
|
return higherTaxonUuidMap.put(higherName, uuid);
|
45
|
}
|
46
|
|
47
|
public UUID removeHigherTaxon(String higherName) {
|
48
|
return higherTaxonUuidMap.remove(higherName);
|
49
|
}
|
50
|
|
51
|
public UUID getHigherTaxon(String higherName) {
|
52
|
return higherTaxonUuidMap.get(higherName);
|
53
|
}
|
54
|
|
55
|
|
56
|
public CentralAfricaChecklistImportState(CentralAfricaChecklistImportConfigurator config) {
|
57
|
super(config);
|
58
|
}
|
59
|
|
60
|
public Map<String, DefinedTermBase> getDbCdmDefinedTermMap(){
|
61
|
return this.dbCdmDefTermMap;
|
62
|
}
|
63
|
|
64
|
public void putDefinedTermToMap(String tableName, String id, DefinedTermBase term){
|
65
|
this.dbCdmDefTermMap.put(tableName + "_" + id, term);
|
66
|
}
|
67
|
|
68
|
public void putDefinedTermToMap(String tableName, int id, DefinedTermBase term){
|
69
|
putDefinedTermToMap(tableName, String.valueOf(id), term);
|
70
|
}
|
71
|
|
72
|
public void setLastFamily(String lastFamily) {
|
73
|
this.lastFamily = lastFamily;
|
74
|
}
|
75
|
|
76
|
public String getLastFamily() {
|
77
|
return lastFamily;
|
78
|
}
|
79
|
|
80
|
public void setLastGenus(String lastGenus) {
|
81
|
this.lastGenus = lastGenus;
|
82
|
}
|
83
|
|
84
|
public String getLastGenus() {
|
85
|
return lastGenus;
|
86
|
}
|
87
|
|
88
|
|
89
|
|
90
|
|
91
|
public Reference getGenevaReference() {
|
92
|
return genevaReference;
|
93
|
}
|
94
|
public void setGenevaReference(Reference genevaReference) {
|
95
|
this.genevaReference = genevaReference;
|
96
|
}
|
97
|
|
98
|
|
99
|
}
|