Project

General

Profile

Download (3.92 KB) Statistics
| Branch: | Revision:
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.iapt;
12

    
13
import java.util.HashMap;
14
import java.util.Map;
15
import java.util.UUID;
16

    
17
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState;
18
import org.apache.log4j.Logger;
19

    
20
import eu.etaxonomy.cdm.io.excel.common.ExcelImportState;
21
import eu.etaxonomy.cdm.io.excel.common.ExcelRowBase;
22
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
23
import eu.etaxonomy.cdm.model.name.BotanicalName;
24
import eu.etaxonomy.cdm.model.reference.Reference;
25
import eu.etaxonomy.cdm.model.taxon.Classification;
26
import eu.etaxonomy.cdm.model.taxon.Taxon;
27
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
28

    
29
/**
30
 * @author a.mueller
31
 * @created 11.05.2009
32
 */
33
public class IAPTImportState extends SimpleExcelTaxonImportState<IAPTImportConfigurator> {
34
	@SuppressWarnings("unused")
35
	private static final Logger logger = Logger.getLogger(IAPTImportState.class);
36

    
37
	private final Map<String, Taxon> higherTaxonTaxonMap = new HashMap<String, Taxon>();
38

    
39
	private final Map<String, UUID> higherTaxonUuidMap = new HashMap<String, UUID>();
40

    
41
    private final Map<String, Taxon> genusTaxonMap = new HashMap<String, Taxon>();
42

    
43
	private final Map<String, BotanicalName> familyNameMap = new HashMap<String, BotanicalName>();
44

    
45
	//classification
46
	private Classification classification;
47
    public Classification getClassification() {return classification;}
48
    public void setClassification(Classification classification) {this.classification = classification;}
49

    
50
    //current taxon
51
    private Taxon currentTaxon;
52
    public Taxon getCurrentTaxon() {return currentTaxon;}
53
    public void setCurrentTaxon(Taxon currentTaxon) {this.currentTaxon = currentTaxon;}
54

    
55
    //rootNode
56
    private TaxonNode rootNode;
57
    public void setRootNode(TaxonNode rootNode) {this.rootNode = rootNode;}
58
    public TaxonNode getRootNode() { return rootNode;}
59

    
60
    private Reference secReference;
61
    public Reference getSecReference() {return secReference;}
62
    public void setSecReference(Reference secReference) {this.secReference = secReference;}
63

    
64
    private PresenceAbsenceTerm highestStatusForTaxon;
65
    public PresenceAbsenceTerm getHighestStatusForTaxon(){return highestStatusForTaxon;}
66
    public void setHighestStatusForTaxon(PresenceAbsenceTerm highestStatusForTaxon){this.highestStatusForTaxon = highestStatusForTaxon;}
67

    
68
    //Constructor
69
    public IAPTImportState(IAPTImportConfigurator config) {
70
		super(config);
71
	}
72

    
73
    //higher taxon
74
    public Taxon getHigherTaxon(String higherName) {
75
        return higherTaxonTaxonMap.get(higherName);
76
    }
77
	public Taxon putHigherTaxon(String higherName, Taxon taxon) {
78
		return higherTaxonTaxonMap.put(higherName, taxon);
79
	}
80
	public Taxon removeHigherTaxon(String higherName) {
81
		return higherTaxonTaxonMap.remove(higherName);
82
	}
83
    public boolean containsHigherTaxon(String higherName) {
84
        return higherTaxonTaxonMap.containsKey(higherName);
85
    }
86

    
87
    //higher taxon uuid
88
    public UUID getHigherTaxonUuid(String higherName) {
89
        return higherTaxonUuidMap.get(higherName);
90
    }
91
	public UUID putHigherTaxon(String higherName, UUID uuid) {
92
		return higherTaxonUuidMap.put(higherName, uuid);
93
	}
94
	public UUID removeHigherTaxonUuid(String higherName) {
95
		return higherTaxonUuidMap.remove(higherName);
96
	}
97
    public boolean containsHigherTaxonUuid(String higherName) {
98
        return higherTaxonUuidMap.containsKey(higherName);
99
    }
100

    
101
    public Map<String, Taxon> getGenusTaxonMap() {
102
        return genusTaxonMap;
103
    }
104

    
105
    Map<UUID, Reference> refMap = new HashMap<UUID, Reference>();
106
    //reference
107
    public Reference getReference(UUID uuidRef) {
108
        return refMap.get(uuidRef);
109
    }
110
    public void putReference(UUID uuidRef, Reference ref) {
111
        refMap.put(uuidRef, ref);
112
    }
113

    
114

    
115
}
(3-3/4)