3 * Copyright (C) 2016 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.
10 package eu
.etaxonomy
.cdm
.io
.mexico
;
12 import java
.util
.HashMap
;
15 import org
.apache
.log4j
.Logger
;
17 import eu
.etaxonomy
.cdm
.io
.excel
.common
.ExcelImportConfiguratorBase
;
18 import eu
.etaxonomy
.cdm
.io
.excel
.common
.ExcelImportState
;
19 import eu
.etaxonomy
.cdm
.io
.excel
.common
.ExcelRowBase
;
20 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
21 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
22 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
23 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
30 public class SimpleExcelTaxonImportState
<CONFIG
extends ExcelImportConfiguratorBase
>
31 extends ExcelImportState
<CONFIG
, ExcelRowBase
>{
33 @SuppressWarnings("unused")
34 private static final Logger logger
= Logger
.getLogger(SimpleExcelTaxonImportState
.class);
36 private Map
<String
, Reference
> refMap
= new HashMap
<>();
38 private Map
<String
, TeamOrPersonBase
<?
>> agentMap
= new HashMap
<>();
40 private final Map
<String
, Taxon
> higherTaxonTaxonMap
= new HashMap
<String
, Taxon
>();
43 private Map
<String
, NonViralName
<?
>> nameMap
= new HashMap
<>();
46 // ************************* CONSTRUCTUR *******************************/
50 public SimpleExcelTaxonImportState(CONFIG config
) {
54 //************************ PUTTER / GETTER *****************************/
55 public void putReference(String title
, Reference ref
){
56 refMap
.put(title
, ref
);
58 public Reference
getReference(String title
){
59 return refMap
.get(title
);
62 public void putAgentBase(String title
, TeamOrPersonBase
<?
> agent
){
63 agentMap
.put(title
, agent
);
65 public TeamOrPersonBase
<?
> getAgentBase(String title
){
66 return agentMap
.get(title
);
70 public Taxon
getHigherTaxon(String higherName
) {
71 return higherTaxonTaxonMap
.get(higherName
);
73 public Taxon
putHigherTaxon(String higherName
, Taxon taxon
) {
74 return higherTaxonTaxonMap
.put(higherName
, taxon
);
76 public Taxon
removeHigherTaxon(String higherName
) {
77 return higherTaxonTaxonMap
.remove(higherName
);
79 public boolean containsHigherTaxon(String higherName
) {
80 return higherTaxonTaxonMap
.containsKey(higherName
);
84 public void putName(String titleCache
, NonViralName
<?
> name
){
85 nameMap
.put(titleCache
, name
);
87 public NonViralName
<?
> getName(String titleCache
){
88 return nameMap
.get(titleCache
);