97f04beb9bca4654ad1bc466de7625732a17f4e5
[cdmlib.git] / cdmlib-io / src / main / java / eu / etaxonomy / cdm / io / excel / taxa / TaxonExcelImportState.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.excel.taxa;
12
13 import java.util.HashMap;
14 import java.util.HashSet;
15 import java.util.Map;
16 import java.util.Set;
17
18 import org.apache.log4j.Logger;
19
20 import eu.etaxonomy.cdm.io.excel.common.ExcelImportConfiguratorBase;
21 import eu.etaxonomy.cdm.io.excel.common.ExcelImportState;
22 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
23 import eu.etaxonomy.cdm.model.taxon.Classification;
24 import eu.etaxonomy.cdm.model.taxon.Taxon;
25 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
26
27 /**
28 * @author a.mueller
29 * @created 11.05.2009
30 * @version 1.0
31 */
32 public class TaxonExcelImportState extends ExcelImportState<ExcelImportConfiguratorBase, NormalExplicitRow>{
33 @SuppressWarnings("unused")
34 private static final Logger logger = Logger.getLogger(TaxonExcelImportState.class);
35
36 /** Already processed authors */
37 private Set<String> authors = new HashSet<String>();
38
39 private Map<Integer, TaxonBase> taxonMap= new HashMap<Integer, TaxonBase>();
40 private Map<String, TeamOrPersonBase> authorMap= new HashMap<String, TeamOrPersonBase>();
41 private Taxon parent;
42 private Classification classification;
43
44
45
46 public TaxonExcelImportState(ExcelImportConfiguratorBase config) {
47 super(config);
48 }
49
50 /**
51 * @return the author
52 */
53 public Set<String> getAuthors() {
54 return authors;
55 }
56
57 /**
58 * @param author the author to set
59 */
60 public void setAuthors(Set<String> authors) {
61 this.authors = authors;
62 }
63
64 public Taxon getParent(){
65 return parent;
66 }
67
68 public void setParent(Taxon parent){
69 this.parent = parent;
70 }
71
72 /**
73 * @param parentId
74 * @return
75 */
76 public TaxonBase getTaxonBase(Integer taxonId) {
77 return taxonMap.get(taxonId);
78 }
79
80
81 /**
82 * @param parentId
83 * @param taxon
84 */
85 public void putTaxon(Integer taxonId, TaxonBase taxonBase) {
86
87
88 taxonMap.put(taxonId, taxonBase);
89 }
90
91 /**
92 * @return the classification
93 */
94 public Classification getClassification() {
95 return classification;
96 }
97
98 /**
99 * @param classification the classification to set
100 */
101 public void setClassification(Classification classification) {
102 this.classification = classification;
103 }
104
105
106
107 }