2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.io
.taxonx
;
12 import org
.apache
.log4j
.Logger
;
14 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
15 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
16 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
17 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
18 import eu
.etaxonomy
.cdm
.model
.occurrence
.Collection
;
19 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivationEvent
;
20 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldObservation
;
21 import eu
.etaxonomy
.cdm
.model
.occurrence
.GatheringEvent
;
22 import eu
.etaxonomy
.cdm
.model
.occurrence
.Specimen
;
29 public class SimpleSpecimen
{
30 private static final Logger logger
= Logger
.getLogger(SimpleSpecimen
.class);
32 private GatheringEvent gatheringEvent
;
33 private FieldObservation fieldObservation
;
34 private DerivationEvent derivationEvent
;
35 private Specimen specimen
;
36 private Collection collection
;
37 private TaxonNameBase
<?
, ?
> storedUnderName
;
38 private String titleCache
;
41 public static SimpleSpecimen
NewInstance(){
42 return new SimpleSpecimen();
45 private SimpleSpecimen(){
46 gatheringEvent
= GatheringEvent
.NewInstance();
49 fieldObservation
= FieldObservation
.NewInstance();
50 fieldObservation
.setGatheringEvent(gatheringEvent
);
53 derivationEvent
= DerivationEvent
.NewInstance();
54 derivationEvent
.addOriginal(fieldObservation
);
57 specimen
= Specimen
.NewInstance();
58 derivationEvent
.addDerivative(specimen
);
61 public LanguageString
getLocality(){
62 return gatheringEvent
.getLocality();
67 * Sets the locality string in the default language
70 public void setLocality(String locality
){
71 Language lang
= Language
.DEFAULT();
72 LanguageString langString
= LanguageString
.NewInstance(locality
, lang
);
73 setLocality(langString
);
76 public void setLocality(LanguageString locality
){
77 gatheringEvent
.setLocality(locality
);
81 * @return the collection
83 public Collection
getCollection() {
88 * @param collection the collection to set
90 public void setCollection(Collection collection
) {
91 this.collection
= collection
;
95 * @return the storedUnderName
97 public TaxonNameBase
<?
, ?
> getStoredUnderName() {
98 return storedUnderName
;
102 * @param storedUnderName the storedUnderName to set
104 public void setStoredUnderName(TaxonNameBase
<?
, ?
> storedUnderName
) {
105 this.storedUnderName
= storedUnderName
;
109 * @return the collection
111 public AgentBase
getCollector() {
112 return gatheringEvent
.getCollector();
115 public void setCollector(AgentBase collector
){
116 gatheringEvent
.setCollector(collector
);
120 * @return the collectorsNumber
122 public String
getCollectorsNumber() {
123 return specimen
.getCollectorsNumber();
127 * @param collectorsNumber the collectorsNumber to set
129 public void setCollectorsNumber(String collectorsNumber
) {
130 this.specimen
.setCollectorsNumber(collectorsNumber
);
135 * @return the specimen
137 public Specimen
getSpecimen() {
142 * @param specimen the specimen to set
144 public void setSpecimen(Specimen specimen
) {
145 this.specimen
= specimen
;
149 * @return the titleCache
151 public String
getTitleCache() {
152 return this.specimen
.getTitleCache();
156 * @param titleCache the titleCache to set
158 public void setTitleCache(String titleCache
) {
159 this.specimen
.setTitleCache(titleCache
);