latest changes for cyprus import
[cdmlib-apps.git] / app-import / src / main / java / eu / etaxonomy / cdm / io / cyprus / CyprusImportState.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.cyprus;
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.common.DbImportStateBase;
20 import eu.etaxonomy.cdm.io.excel.common.ExcelImportState;
21 import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitRow;
22 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
23 import eu.etaxonomy.cdm.model.common.MarkerType;
24 import eu.etaxonomy.cdm.model.common.User;
25 import eu.etaxonomy.cdm.model.reference.Reference;
26 import eu.etaxonomy.cdm.model.taxon.Taxon;
27
28 /**
29 * @author a.mueller
30 * @created 11.05.2009
31 * @version 1.0
32 */
33 public class CyprusImportState extends ExcelImportState{
34 @SuppressWarnings("unused")
35 private static final Logger logger = Logger.getLogger(CyprusImportState.class);
36
37 private Map<String, DefinedTermBase> dbCdmDefTermMap = new HashMap<String, DefinedTermBase>();
38
39 // private String lastFamily;
40 // private String lastGenus;
41 // private Map<String, UUID> higherTaxonUuidMap = new HashMap<String, UUID>();
42 private Map<String, Taxon> higherTaxonTaxonMap = new HashMap<String, Taxon>();
43
44 private CyprusRow cyprusRow;
45
46 public boolean containsHigherTaxon(String higherName) {
47 return higherTaxonTaxonMap.containsKey(higherName);
48 }
49
50 public Taxon putHigherTaxon(String higherName, Taxon taxon) {
51 return higherTaxonTaxonMap.put(higherName, taxon);
52 }
53
54 public Taxon removeHigherTaxon(String higherName) {
55 return higherTaxonTaxonMap.remove(higherName);
56 }
57
58 public Taxon getHigherTaxon(String higherName) {
59 return higherTaxonTaxonMap.get(higherName);
60 }
61
62
63
64
65 // public boolean containsHigherTaxonUuid(String higherName) {
66 // return higherTaxonUuidMap.containsKey(higherName);
67 // }
68 //
69 // public UUID putHigherTaxon(String higherName, UUID uuid) {
70 // return higherTaxonUuidMap.put(higherName, uuid);
71 // }
72 //
73 // public UUID removeHigherTaxon(String higherName) {
74 // return higherTaxonUuidMap.remove(higherName);
75 // }
76 //
77 // public UUID getHigherTaxon(String higherName) {
78 // return higherTaxonUuidMap.get(higherName);
79 // }
80
81
82
83 /**
84 * @return the cyprusRow
85 */
86 public CyprusRow getCyprusRow() {
87 return cyprusRow;
88 }
89
90 /**
91 * @param cyprusRow the normalExplicitRow to set
92 */
93 public void setCyprusRow(CyprusRow cyprusRow) {
94 this.cyprusRow = cyprusRow;
95 }
96
97 public CyprusImportState(CyprusImportConfigurator config) {
98 super(config);
99 }
100
101 public Map<String, DefinedTermBase> getDbCdmDefinedTermMap(){
102 return this.dbCdmDefTermMap;
103 }
104
105 public void putDefinedTermToMap(String tableName, String id, DefinedTermBase term){
106 this.dbCdmDefTermMap.put(tableName + "_" + id, term);
107 }
108
109 public void putDefinedTermToMap(String tableName, int id, DefinedTermBase term){
110 putDefinedTermToMap(tableName, String.valueOf(id), term);
111 }
112
113
114
115
116 // public void setLastFamily(String lastFamily) {
117 // this.lastFamily = lastFamily;
118 // }
119 //
120 // public String getLastFamily() {
121 // return lastFamily;
122 // }
123 //
124 // public void setLastGenus(String lastGenus) {
125 // this.lastGenus = lastGenus;
126 // }
127 //
128 // public String getLastGenus() {
129 // return lastGenus;
130 // }
131
132
133
134
135 }