Project

General

Profile

Download (35.6 KB) Statistics
| Branch: | Tag: | Revision:
1 9479da48 Andreas Müller
/**
2
* Copyright (C) 2007 EDIT
3 8ba55ff3 Patric Plitzner
* European Distributed Institute of Taxonomy
4 9479da48 Andreas Müller
* http://www.e-taxonomy.eu
5 8ba55ff3 Patric Plitzner
*
6 9479da48 Andreas Müller
* 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.
8
*/
9
10
package eu.etaxonomy.cdm.model.description;
11
12
13 892efc69 Andreas Kohlbecker
import java.util.HashMap;
14 6b8f5129 Andreas Müller
import java.util.HashSet;
15 1016f650 Andreas Müller
import java.util.List;
16 f6765014 ben.clark
import java.util.Map;
17 6b8f5129 Andreas Müller
import java.util.Set;
18
import java.util.UUID;
19 de3e2329 Andreas Müller
20 6b8f5129 Andreas Müller
import javax.persistence.Entity;
21 f6765014 ben.clark
import javax.persistence.FetchType;
22 c5e86e43 a.babadshanjan
import javax.persistence.JoinTable;
23
import javax.persistence.ManyToMany;
24 6b8f5129 Andreas Müller
import javax.persistence.OneToMany;
25 4393fcb0 a.babadshanjan
import javax.xml.bind.annotation.XmlAccessType;
26
import javax.xml.bind.annotation.XmlAccessorType;
27
import javax.xml.bind.annotation.XmlElement;
28
import javax.xml.bind.annotation.XmlElementWrapper;
29
import javax.xml.bind.annotation.XmlIDREF;
30
import javax.xml.bind.annotation.XmlRootElement;
31
import javax.xml.bind.annotation.XmlSchemaType;
32 6b8f5129 Andreas Müller
import javax.xml.bind.annotation.XmlType;
33 9479da48 Andreas Müller
34 6b8f5129 Andreas Müller
import org.apache.log4j.Logger;
35 ee91bcd9 ben.clark
import org.hibernate.envers.Audited;
36 fd7ee7b1 ben.clark
import org.hibernate.search.annotations.Indexed;
37 9479da48 Andreas Müller
38 533cbb43 Andreas Müller
import eu.etaxonomy.cdm.model.common.DefinedTerm;
39 6b8f5129 Andreas Müller
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
40 1016f650 Andreas Müller
import eu.etaxonomy.cdm.model.common.Language;
41 533cbb43 Andreas Müller
import eu.etaxonomy.cdm.model.common.TermType;
42 6b8f5129 Andreas Müller
import eu.etaxonomy.cdm.model.common.TermVocabulary;
43 4daf2f37 m.geoffroy
import eu.etaxonomy.cdm.model.name.BotanicalName;
44
import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
45 8ba55ff3 Patric Plitzner
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
46
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
47
import eu.etaxonomy.cdm.model.taxon.Taxon;
48 9479da48 Andreas Müller
49
/**
50 4daf2f37 m.geoffroy
 * The class for individual properties (also designed as character, type or
51
 * category) of observed phenomena able to be described or measured. It also
52
 * covers categories of informations on {@link TaxonNameBase taxon names} not
53
 * taken in account in {@link NomenclaturalCode nomenclature}.<BR>
54 8ba55ff3 Patric Plitzner
 * Descriptions require features in order to be structured and disaggregated
55 4daf2f37 m.geoffroy
 * in {@link DescriptionElementBase description elements}.<BR>
56 b22e4839 m.geoffroy
 * Experts do not use the word feature for the actual description
57
 * but only for the property itself. Therefore naming this class FeatureType
58 4daf2f37 m.geoffroy
 * would have leaded to confusion.
59
 * <P>
60 509b132a m.geoffroy
 * Since features are {@link DefinedTermBase defined terms} they have a hierarchical
61
 * structure that allows to specify ("kind of") or generalize
62
 * ("generalization of") features. "Kind of" / "generalization of" relations
63
 * are bidirectional (a feature F1 is a "Kind of" a feature F2 if and only
64
 * if the feature F2 is a "generalization of" the feature F1. This hierarchical
65
 * structure has nothing in common with {@link FeatureTree feature trees} used for determination.
66 8ba55ff3 Patric Plitzner
 * <P>
67 4daf2f37 m.geoffroy
 * A standard set of feature instances will be automatically
68
 * created as the project starts. But this class allows to extend this standard
69
 * set by creating new instances of additional features if needed.<BR>
70
 * <P>
71
 * This class corresponds to DescriptionsSectionType according to the SDD
72
 * schema.
73 8ba55ff3 Patric Plitzner
 *
74 9479da48 Andreas Müller
 * @author m.doering
75
 * @created 08-Nov-2007 13:06:24
76
 */
77 c9866164 ben.clark
@XmlAccessorType(XmlAccessType.PROPERTY)
78 4393fcb0 a.babadshanjan
@XmlType(name="Feature", factoryMethod="NewInstance", propOrder = {
79 c9866164 ben.clark
		"kindOf",
80
		"generalizationOf",
81
		"partOf",
82
		"includes",
83 4393fcb0 a.babadshanjan
	    "supportsTextData",
84
	    "supportsQuantitativeData",
85
	    "supportsDistribution",
86
	    "supportsIndividualAssociation",
87
	    "supportsTaxonInteraction",
88
	    "supportsCommonTaxonName",
89 3190e7d8 ben.clark
	    "supportsCategoricalData",
90 4393fcb0 a.babadshanjan
	    "recommendedModifierEnumeration",
91
	    "recommendedStatisticalMeasures",
92 52931327 h.fradin
	    "supportedCategoricalEnumerations",
93
	    "recommendedMeasurementUnits"
94 4393fcb0 a.babadshanjan
})
95
@XmlRootElement(name = "Feature")
96 9479da48 Andreas Müller
@Entity
97 fd7ee7b1 ben.clark
@Indexed(index = "eu.etaxonomy.cdm.model.common.DefinedTermBase")
98 ee91bcd9 ben.clark
@Audited
99 03abbcde Andreas Müller
public class Feature extends DefinedTermBase<Feature> {
100
	private static final long serialVersionUID = 6754598791831848704L;
101
	private static final Logger logger = Logger.getLogger(Feature.class);
102 8ba55ff3 Patric Plitzner
103
	protected static Map<UUID, Feature> termMap = null;
104 9479da48 Andreas Müller
105 05f4da4e Andreas Müller
	private boolean supportsTextData = true;   //by default text data should be always supported
106 8ba55ff3 Patric Plitzner
107 1016f650 Andreas Müller
	private boolean supportsQuantitativeData;
108 8ba55ff3 Patric Plitzner
109 9479da48 Andreas Müller
	private boolean supportsDistribution;
110 8ba55ff3 Patric Plitzner
111 9479da48 Andreas Müller
	private boolean supportsIndividualAssociation;
112 8ba55ff3 Patric Plitzner
113 9479da48 Andreas Müller
	private boolean supportsTaxonInteraction;
114 8ba55ff3 Patric Plitzner
115 b2231758 h.fradin
	private boolean supportsCategoricalData;
116 8ba55ff3 Patric Plitzner
117
	private boolean supportsCommonTaxonName;
118
119 ee91bcd9 ben.clark
	/*
120
	 * FIXME Should this be Many-To-Many or do we expect each Feature to have its own unique modifier enums?
121
	 */
122
	@OneToMany(fetch = FetchType.LAZY)
123
    @JoinTable(name="DefinedTermBase_RecommendedModifierEnumeration")
124 8ba55ff3 Patric Plitzner
	private final Set<TermVocabulary<DefinedTerm>> recommendedModifierEnumeration = new HashSet<TermVocabulary<DefinedTerm>>();
125
126
127 ee91bcd9 ben.clark
	@ManyToMany(fetch = FetchType.LAZY)
128
    @JoinTable(name="DefinedTermBase_StatisticalMeasure")
129 8ba55ff3 Patric Plitzner
	private final Set<StatisticalMeasure> recommendedStatisticalMeasures = new HashSet<StatisticalMeasure>();
130
131 ee91bcd9 ben.clark
	/*
132
	 * FIXME Should this be Many-To-Many or do we expect each Feature to have its own unique state enums?
133
	 */
134
	@OneToMany(fetch = FetchType.LAZY)
135
    @JoinTable(name="DefinedTermBase_SupportedCategoricalEnumeration")
136 8ba55ff3 Patric Plitzner
	private final Set<TermVocabulary<State>> supportedCategoricalEnumerations = new HashSet<TermVocabulary<State>>();
137
138 17a0cbe8 ben.clark
139 52931327 h.fradin
	@ManyToMany(fetch = FetchType.LAZY)
140
    @JoinTable(name="DefinedTermBase_MeasurementUnit")
141 8ba55ff3 Patric Plitzner
	private final Set<MeasurementUnit> recommendedMeasurementUnits = new HashSet<MeasurementUnit>();
142
143 d80a0479 Andreas Müller
/* ***************** CONSTRUCTOR AND FACTORY METHODS **********************************/
144 8ba55ff3 Patric Plitzner
145 9e3239f6 Andreas Müller
	//for hibernate use only
146
	@Deprecated
147
	protected Feature() {
148
		super(TermType.Feature);
149 d80a0479 Andreas Müller
	}
150 8ba55ff3 Patric Plitzner
151
	/**
152 4daf2f37 m.geoffroy
	 * Class constructor: creates a new feature instance with a description (in the {@link Language#DEFAULT() default language}),
153
	 * a label and a label abbreviation.
154 8ba55ff3 Patric Plitzner
	 *
155 4daf2f37 m.geoffroy
	 * @param	term  		 the string (in the default language) describing the
156 8ba55ff3 Patric Plitzner
	 * 						 new feature to be created
157 4daf2f37 m.geoffroy
	 * @param	label  		 the string identifying the new feature to be created
158
	 * @param	labelAbbrev  the string identifying (in abbreviated form) the
159
	 * 						 new feature to be created
160
	 * @see 				 #Feature()
161
	 */
162 41b23b4e Andreas Müller
	protected Feature(String term, String label, String labelAbbrev) {
163 533cbb43 Andreas Müller
		super(TermType.Feature, term, label, labelAbbrev);
164 9479da48 Andreas Müller
	}
165
166 8ba55ff3 Patric Plitzner
	/**
167 4daf2f37 m.geoffroy
	 * Creates a new empty feature instance.
168 8ba55ff3 Patric Plitzner
	 *
169 4daf2f37 m.geoffroy
	 * @see #NewInstance(String, String, String)
170
	 */
171
	public static Feature NewInstance() {
172
		return new Feature();
173
	}
174 8ba55ff3 Patric Plitzner
175
	/**
176 4daf2f37 m.geoffroy
	 * Creates a new feature instance with a description (in the {@link Language#DEFAULT() default language}),
177
	 * a label and a label abbreviation.
178 8ba55ff3 Patric Plitzner
	 *
179 4daf2f37 m.geoffroy
	 * @param	term  		 the string (in the default language) describing the
180 8ba55ff3 Patric Plitzner
	 * 						 new feature to be created
181 4daf2f37 m.geoffroy
	 * @param	label  		 the string identifying the new feature to be created
182
	 * @param	labelAbbrev  the string identifying (in abbreviated form) the
183
	 * 						 new feature to be created
184
	 * @see 				 #readCsvLine(List, Language)
185
	 * @see 				 #NewInstance()
186
	 */
187
	public static Feature NewInstance(String term, String label, String labelAbbrev){
188
		return new Feature(term, label, labelAbbrev);
189
	}
190
191 d80a0479 Andreas Müller
/* *************************************************************************************/
192 8ba55ff3 Patric Plitzner
193
194 8cc82a87 Andreas Müller
	/* (non-Javadoc)
195
	 * @see eu.etaxonomy.cdm.model.common.DefinedTermBase#resetTerms()
196
	 */
197
	@Override
198
	public void resetTerms(){
199
		termMap = null;
200
	}
201
202 8ba55ff3 Patric Plitzner
203 4daf2f37 m.geoffroy
	/**
204
	 * Returns the boolean value of the flag indicating whether <i>this</i>
205
	 * feature can be described with {@link QuantitativeData quantitative data} (true)
206
	 * or not (false). If this flag is set <i>this</i> feature can only apply to
207
	 * {@link TaxonDescription taxon descriptions} or {@link SpecimenDescription specimen descriptions}.
208 8ba55ff3 Patric Plitzner
	 *
209 4daf2f37 m.geoffroy
	 * @return  the boolean value of the supportsQuantitativeData flag
210
	 */
211 17a0cbe8 ben.clark
	@XmlElement(name = "SupportsQuantitativeData")
212
	public boolean isSupportsQuantitativeData() {
213 9479da48 Andreas Müller
		return supportsQuantitativeData;
214
	}
215
216 4daf2f37 m.geoffroy
	/**
217 8ba55ff3 Patric Plitzner
	 * @see	#isSupportsQuantitativeData()
218 4daf2f37 m.geoffroy
	 */
219 9479da48 Andreas Müller
	public void setSupportsQuantitativeData(boolean supportsQuantitativeData) {
220
		this.supportsQuantitativeData = supportsQuantitativeData;
221
	}
222
223 4daf2f37 m.geoffroy
	/**
224
	 * Returns the boolean value of the flag indicating whether <i>this</i>
225
	 * feature can be described with {@link TextData text data} (true)
226
	 * or not (false).
227 8ba55ff3 Patric Plitzner
	 *
228 4daf2f37 m.geoffroy
	 * @return  the boolean value of the supportsTextData flag
229
	 */
230 17a0cbe8 ben.clark
	@XmlElement(name = "SupportsTextData")
231
	public boolean isSupportsTextData() {
232 9479da48 Andreas Müller
		return supportsTextData;
233
	}
234
235 4daf2f37 m.geoffroy
	/**
236 8ba55ff3 Patric Plitzner
	 * @see	#isSupportsTextData()
237 4daf2f37 m.geoffroy
	 */
238 9479da48 Andreas Müller
	public void setSupportsTextData(boolean supportsTextData) {
239
		this.supportsTextData = supportsTextData;
240
	}
241
242 4daf2f37 m.geoffroy
	/**
243
	 * Returns the boolean value of the flag indicating whether <i>this</i>
244
	 * feature can be described with {@link Distribution distribution} objects
245
	 * (true) or not (false). This flag is set if and only if <i>this</i> feature
246
	 * is the {@link #DISTRIBUTION() distribution feature}.
247 8ba55ff3 Patric Plitzner
	 *
248 4daf2f37 m.geoffroy
	 * @return  the boolean value of the supportsDistribution flag
249
	 */
250 17a0cbe8 ben.clark
	@XmlElement(name = "SupportsDistribution")
251
	public boolean isSupportsDistribution() {
252 9479da48 Andreas Müller
		return supportsDistribution;
253
	}
254
255 4daf2f37 m.geoffroy
	/**
256 8ba55ff3 Patric Plitzner
	 * @see	#isSupportsDistribution()
257 4daf2f37 m.geoffroy
	 */
258 9479da48 Andreas Müller
	public void setSupportsDistribution(boolean supportsDistribution) {
259
		this.supportsDistribution = supportsDistribution;
260
	}
261
262 4daf2f37 m.geoffroy
	/**
263
	 * Returns the boolean value of the flag indicating whether <i>this</i>
264
	 * feature can be described with {@link IndividualsAssociation individuals associations}
265
	 * (true) or not (false).
266 8ba55ff3 Patric Plitzner
	 *
267 4daf2f37 m.geoffroy
	 * @return  the boolean value of the supportsIndividualAssociation flag
268
	 */
269 17a0cbe8 ben.clark
	@XmlElement(name = "SupportsIndividualAssociation")
270
	public boolean isSupportsIndividualAssociation() {
271 9479da48 Andreas Müller
		return supportsIndividualAssociation;
272
	}
273
274 4daf2f37 m.geoffroy
	/**
275 8ba55ff3 Patric Plitzner
	 * @see	#isSupportsIndividualAssociation()
276 4daf2f37 m.geoffroy
	 */
277 9479da48 Andreas Müller
	public void setSupportsIndividualAssociation(
278
			boolean supportsIndividualAssociation) {
279
		this.supportsIndividualAssociation = supportsIndividualAssociation;
280
	}
281
282 4daf2f37 m.geoffroy
	/**
283
	 * Returns the boolean value of the flag indicating whether <i>this</i>
284
	 * feature can be described with {@link TaxonInteraction taxon interactions}
285
	 * (true) or not (false).
286 8ba55ff3 Patric Plitzner
	 *
287 4daf2f37 m.geoffroy
	 * @return  the boolean value of the supportsTaxonInteraction flag
288
	 */
289 17a0cbe8 ben.clark
	@XmlElement(name = "SupportsTaxonInteraction")
290
	public boolean isSupportsTaxonInteraction() {
291 9479da48 Andreas Müller
		return supportsTaxonInteraction;
292
	}
293
294 4daf2f37 m.geoffroy
	/**
295 8ba55ff3 Patric Plitzner
	 * @see	#isSupportsTaxonInteraction()
296 4daf2f37 m.geoffroy
	 */
297 9479da48 Andreas Müller
	public void setSupportsTaxonInteraction(boolean supportsTaxonInteraction) {
298
		this.supportsTaxonInteraction = supportsTaxonInteraction;
299
	}
300
301 4daf2f37 m.geoffroy
	/**
302
	 * Returns the boolean value of the flag indicating whether <i>this</i>
303
	 * feature can be described with {@link CommonTaxonName common names}
304
	 * (true) or not (false). This flag is set if and only if <i>this</i> feature
305
	 * is the {@link #COMMON_NAME() common name feature}.
306 8ba55ff3 Patric Plitzner
	 *
307 4daf2f37 m.geoffroy
	 * @return  the boolean value of the supportsCommonTaxonName flag
308
	 */
309 17a0cbe8 ben.clark
	@XmlElement(name = "SupportsCommonTaxonName")
310
	public boolean isSupportsCommonTaxonName() {
311 9479da48 Andreas Müller
		return supportsCommonTaxonName;
312
	}
313
314 4daf2f37 m.geoffroy
	/**
315 8ba55ff3 Patric Plitzner
	 * @see	#isSupportsTaxonInteraction()
316 4daf2f37 m.geoffroy
	 */
317 9479da48 Andreas Müller
	public void setSupportsCommonTaxonName(boolean supportsCommonTaxonName) {
318
		this.supportsCommonTaxonName = supportsCommonTaxonName;
319
	}
320
321 b2231758 h.fradin
	/**
322
	 * Returns the boolean value of the flag indicating whether <i>this</i>
323
	 * feature can be described with {@link CategoricalData categorical data}
324
	 * (true) or not (false).
325 8ba55ff3 Patric Plitzner
	 *
326 b2231758 h.fradin
	 * @return  the boolean value of the supportsCategoricalData flag
327
	 */
328 17a0cbe8 ben.clark
	@XmlElement(name = "SupportsCategoricalData")
329
	public boolean isSupportsCategoricalData() {
330 b2231758 h.fradin
		return supportsCategoricalData;
331
	}
332
333
	/**
334 8ba55ff3 Patric Plitzner
	 * @see	#supportsCategoricalData()
335 b2231758 h.fradin
	 */
336
	public void setSupportsCategoricalData(boolean supportsCategoricalData) {
337
		this.supportsCategoricalData = supportsCategoricalData;
338
	}
339
340 8ba55ff3 Patric Plitzner
341 4daf2f37 m.geoffroy
	/**
342
	 * Returns the set of {@link TermVocabulary term vocabularies} containing the
343
	 * {@link Modifier modifiers} recommended to be used for {@link DescriptionElementBase description elements}
344
	 * with <i>this</i> feature.
345 8ba55ff3 Patric Plitzner
	 *
346 4daf2f37 m.geoffroy
	 */
347 17a0cbe8 ben.clark
	@XmlElementWrapper(name = "RecommendedModifierEnumerations")
348
	@XmlElement(name = "RecommendedModifierEnumeration")
349
	@XmlIDREF
350
	@XmlSchemaType(name = "IDREF")
351 533cbb43 Andreas Müller
	public Set<TermVocabulary<DefinedTerm>> getRecommendedModifierEnumeration() {
352 9479da48 Andreas Müller
		return recommendedModifierEnumeration;
353
	}
354
355 4daf2f37 m.geoffroy
	/**
356
	 * Adds a {@link TermVocabulary term vocabulary} (with {@link Modifier modifiers}) to the set of
357
	 * {@link #getRecommendedModifierEnumeration() recommended modifier vocabularies} assigned
358
	 * to <i>this</i> feature.
359 8ba55ff3 Patric Plitzner
	 *
360 4daf2f37 m.geoffroy
	 * @param recommendedModifierEnumeration	the term vocabulary to be added
361
	 * @see    	   								#getRecommendedModifierEnumeration()
362
	 */
363 9479da48 Andreas Müller
	public void addRecommendedModifierEnumeration(
364 533cbb43 Andreas Müller
			TermVocabulary<DefinedTerm> recommendedModifierEnumeration) {
365 9479da48 Andreas Müller
		this.recommendedModifierEnumeration.add(recommendedModifierEnumeration);
366
	}
367 8ba55ff3 Patric Plitzner
	/**
368 4daf2f37 m.geoffroy
	 * Removes one element from the set of {@link #getRecommendedModifierEnumeration() recommended modifier vocabularies}
369
	 * assigned to <i>this</i> feature.
370
	 *
371
	 * @param  recommendedModifierEnumeration	the term vocabulary which should be removed
372
	 * @see     								#getRecommendedModifierEnumeration()
373
	 * @see     								#addRecommendedModifierEnumeration(TermVocabulary)
374
	 */
375 9479da48 Andreas Müller
	public void removeRecommendedModifierEnumeration(
376 533cbb43 Andreas Müller
			TermVocabulary<DefinedTerm> recommendedModifierEnumeration) {
377 9479da48 Andreas Müller
		this.recommendedModifierEnumeration.remove(recommendedModifierEnumeration);
378
	}
379
380 4daf2f37 m.geoffroy
	/**
381
	 * Returns the set of {@link StatisticalMeasure statistical measures} recommended to be used
382
	 * in case of {@link QuantitativeData quantitative data} with <i>this</i> feature.
383
	 */
384 17a0cbe8 ben.clark
	@XmlElementWrapper(name = "RecommendedStatisticalMeasures")
385
	@XmlElement(name = "RecommendedStatisticalMeasure")
386
	@XmlIDREF
387
	@XmlSchemaType(name = "IDREF")
388 9479da48 Andreas Müller
	public Set<StatisticalMeasure> getRecommendedStatisticalMeasures() {
389
		return recommendedStatisticalMeasures;
390
	}
391
392 4daf2f37 m.geoffroy
	/**
393
	 * Adds a {@link StatisticalMeasure statistical measure} to the set of
394
	 * {@link #getRecommendedStatisticalMeasures() recommended statistical measures} assigned
395
	 * to <i>this</i> feature.
396 8ba55ff3 Patric Plitzner
	 *
397 4daf2f37 m.geoffroy
	 * @param recommendedStatisticalMeasure	the statistical measure to be added
398
	 * @see    	   							#getRecommendedStatisticalMeasures()
399
	 */
400 9479da48 Andreas Müller
	public void addRecommendedStatisticalMeasure(
401
			StatisticalMeasure recommendedStatisticalMeasure) {
402
		this.recommendedStatisticalMeasures.add(recommendedStatisticalMeasure);
403
	}
404 8ba55ff3 Patric Plitzner
	/**
405 4daf2f37 m.geoffroy
	 * Removes one element from the set of {@link #getRecommendedStatisticalMeasures() recommended statistical measures}
406
	 * assigned to <i>this</i> feature.
407
	 *
408
	 * @param  recommendedStatisticalMeasure	the statistical measure which should be removed
409
	 * @see     								#getRecommendedStatisticalMeasures()
410
	 * @see     								#addRecommendedStatisticalMeasure(StatisticalMeasure)
411
	 */
412 9479da48 Andreas Müller
	public void removeRecommendedStatisticalMeasure(
413
			StatisticalMeasure recommendedStatisticalMeasure) {
414
		this.recommendedStatisticalMeasures.remove(recommendedStatisticalMeasure);
415
	}
416
417 52931327 h.fradin
	/**
418
	 * Returns the set of {@link StatisticalMeasure statistical measures} recommended to be used
419
	 * in case of {@link QuantitativeData quantitative data} with <i>this</i> feature.
420
	 */
421 17a0cbe8 ben.clark
	@XmlElementWrapper(name = "RecommendedMeasurementUnits")
422
	@XmlElement(name = "RecommendedMeasurementUnit")
423
	@XmlIDREF
424
	@XmlSchemaType(name = "IDREF")
425 52931327 h.fradin
	public Set<MeasurementUnit> getRecommendedMeasurementUnits() {
426
		return recommendedMeasurementUnits;
427
	}
428
429
	/**
430
	 * Adds a {@link StatisticalMeasure statistical measure} to the set of
431
	 * {@link #getRecommendedStatisticalMeasures() recommended statistical measures} assigned
432
	 * to <i>this</i> feature.
433 8ba55ff3 Patric Plitzner
	 *
434 52931327 h.fradin
	 * @param recommendedStatisticalMeasure	the statistical measure to be added
435
	 * @see    	   							#getRecommendedStatisticalMeasures()
436
	 */
437
	public void addRecommendedMeasurementUnit(
438
			MeasurementUnit recommendedMeasurementUnit) {
439
		this.recommendedMeasurementUnits.add(recommendedMeasurementUnit);
440
	}
441 8ba55ff3 Patric Plitzner
	/**
442 52931327 h.fradin
	 * Removes one element from the set of {@link #getRecommendedStatisticalMeasures() recommended statistical measures}
443
	 * assigned to <i>this</i> feature.
444
	 *
445
	 * @param  recommendedStatisticalMeasure	the statistical measure which should be removed
446
	 * @see     								#getRecommendedStatisticalMeasures()
447
	 * @see     								#addRecommendedStatisticalMeasure(StatisticalMeasure)
448
	 */
449
	public void removeRecommendedMeasurementUnit(
450
			MeasurementUnit recommendedMeasurementUnit) {
451
		this.recommendedMeasurementUnits.remove(recommendedMeasurementUnit);
452
	}
453 8ba55ff3 Patric Plitzner
454 4daf2f37 m.geoffroy
	/**
455
	 * Returns the set of {@link TermVocabulary term vocabularies} containing the list of
456
	 * possible {@link State states} to be used in {@link CategoricalData categorical data}
457
	 * with <i>this</i> feature.
458 8ba55ff3 Patric Plitzner
	 *
459 4daf2f37 m.geoffroy
	 */
460 17a0cbe8 ben.clark
	@XmlElementWrapper(name = "SupportedCategoricalEnumerations")
461
	@XmlElement(name = "SupportedCategoricalEnumeration")
462
	@XmlIDREF
463
	@XmlSchemaType(name = "IDREF")
464 f6765014 ben.clark
	public Set<TermVocabulary<State>> getSupportedCategoricalEnumerations() {
465 9479da48 Andreas Müller
		return supportedCategoricalEnumerations;
466
	}
467
468 4daf2f37 m.geoffroy
	/**
469
	 * Adds a {@link TermVocabulary term vocabulary} to the set of
470
	 * {@link #getSupportedCategoricalEnumerations() supported state vocabularies} assigned
471
	 * to <i>this</i> feature.
472 8ba55ff3 Patric Plitzner
	 *
473 4daf2f37 m.geoffroy
	 * @param supportedCategoricalEnumeration	the term vocabulary which should be removed
474
	 * @see    	   								#getSupportedCategoricalEnumerations()
475
	 */
476 9479da48 Andreas Müller
	public void addSupportedCategoricalEnumeration(
477 f6765014 ben.clark
			TermVocabulary<State> supportedCategoricalEnumeration) {
478 9479da48 Andreas Müller
		this.supportedCategoricalEnumerations.add(supportedCategoricalEnumeration);
479
	}
480 8ba55ff3 Patric Plitzner
	/**
481 4daf2f37 m.geoffroy
	 * Removes one element from the set of {@link #getSupportedCategoricalEnumerations() supported state vocabularies}
482
	 * assigned to <i>this</i> feature.
483
	 *
484
	 * @param  supportedCategoricalEnumeration	the term vocabulary which should be removed
485
	 * @see     								#getSupportedCategoricalEnumerations()
486
	 * @see     								#addSupportedCategoricalEnumeration(TermVocabulary)
487
	 */
488 9479da48 Andreas Müller
	public void removeSupportedCategoricalEnumeration(
489 f6765014 ben.clark
			TermVocabulary<State> supportedCategoricalEnumeration) {
490 9479da48 Andreas Müller
		this.supportedCategoricalEnumerations.remove(supportedCategoricalEnumeration);
491
	}
492 8ba55ff3 Patric Plitzner
493 c9866164 ben.clark
	@XmlElement(name = "KindOf", namespace = "http://etaxonomy.eu/cdm/model/common/1.0")
494
    @XmlIDREF
495
    @XmlSchemaType(name = "IDREF")
496 17a0cbe8 ben.clark
    @Override
497 c9866164 ben.clark
	public Feature getKindOf(){
498
		return super.getKindOf();
499
	}
500
501 8ba55ff3 Patric Plitzner
	@Override
502
    public void setKindOf(Feature kindOf){
503 c9866164 ben.clark
		super.setKindOf(kindOf);
504
	}
505 8ba55ff3 Patric Plitzner
506
	@Override
507
    @XmlElement(name = "PartOf", namespace = "http://etaxonomy.eu/cdm/model/common/1.0")
508 c9866164 ben.clark
	@XmlIDREF
509
    @XmlSchemaType(name = "IDREF")
510
	public Feature getPartOf(){
511
		return super.getPartOf();
512
	}
513 8ba55ff3 Patric Plitzner
514
	@Override
515
    public void setPartOf(Feature partOf){
516 c9866164 ben.clark
		super.setPartOf(partOf);
517
	}
518 8ba55ff3 Patric Plitzner
519
	@Override
520
    @XmlElementWrapper(name = "Generalizations", namespace = "http://etaxonomy.eu/cdm/model/common/1.0")
521 c9866164 ben.clark
	@XmlElement(name = "GeneralizationOf", namespace = "http://etaxonomy.eu/cdm/model/common/1.0")
522
    @XmlIDREF
523
    @XmlSchemaType(name = "IDREF")
524
	public Set<Feature> getGeneralizationOf(){
525
		return super.getGeneralizationOf();
526
	}
527 8ba55ff3 Patric Plitzner
528
	@Override
529
    protected void setGeneralizationOf(Set<Feature> value){
530 c9866164 ben.clark
		super.setGeneralizationOf(value);
531
	}
532 8ba55ff3 Patric Plitzner
533
	@Override
534
    @XmlElementWrapper(name = "Includes", namespace = "http://etaxonomy.eu/cdm/model/common/1.0")
535 c9866164 ben.clark
	@XmlElement(name = "Include", namespace = "http://etaxonomy.eu/cdm/model/common/1.0")
536
	@XmlIDREF
537
    @XmlSchemaType(name = "IDREF")
538
	public Set<Feature> getIncludes(){
539
		return super.getIncludes();
540
	}
541 8ba55ff3 Patric Plitzner
542
	@Override
543
    protected void setIncludes(Set<Feature> includes) {
544 c9866164 ben.clark
		super.setIncludes(includes);
545
	}
546 8ba55ff3 Patric Plitzner
547 a8113d09 Andreas Müller
	private static final UUID uuidUnknown = UUID.fromString("910307f1-dc3c-452c-a6dd-af5ac7cd365c");
548 de3e2329 Andreas Müller
	private static final UUID uuidDescription = UUID.fromString("9087cdcd-8b08-4082-a1de-34c9ba9fb493");
549
	private static final UUID uuidDistribution = UUID.fromString("9fc9d10c-ba50-49ee-b174-ce83fc3f80c6");
550
	private static final UUID uuidEcology = UUID.fromString("aa923827-d333-4cf5-9a5f-438ae0a4746b");
551 95742cf8 Andreas Müller
	private static final UUID uuidHabitat = UUID.fromString("fb16929f-bc9c-456f-9d40-dec987b36438");
552
	private static final UUID uuidHabitatAndEcology = UUID.fromString("9fdc4663-4d56-47d0-90b5-c0bf251bafbb");
553
	private static final UUID uuidChromosomeNumber = UUID.fromString("6f677e98-d8d5-4bc5-80bf-affdb7e3945a");
554 8ba55ff3 Patric Plitzner
555 de3e2329 Andreas Müller
	private static final UUID uuidBiologyEcology = UUID.fromString("9832e24f-b670-43b4-ac7c-20a7261a1d8c");
556
	private static final UUID uuidKey = UUID.fromString("a677f827-22b9-4205-bb37-11cb48dd9106");
557
	private static final UUID uuidMaterialsExamined = UUID.fromString("7c0c7571-a864-47c1-891d-01f59000dae1");
558
	private static final UUID uuidMaterialsMethods = UUID.fromString("1e87d9c3-0844-4a03-9686-773e2ccb3ab6");
559
	private static final UUID uuidEtymology = UUID.fromString("dd653d48-355c-4aec-a4e7-724f6eb29f8d");
560
	private static final UUID uuidDiagnosis = UUID.fromString("d43d8501-ceab-4caa-9e51-e87138528fac");
561 892efc69 Andreas Kohlbecker
	private static final UUID uuidProtologue = UUID.fromString("71b356c5-1e3f-4f5d-9b0f-c2cf8ae7779f");
562 dfa65fb3 Andreas Müller
	private static final UUID uuidCommonName = UUID.fromString("fc810911-51f0-4a46-ab97-6562fe263ae5");
563 6b8f5129 Andreas Müller
	private static final UUID uuidPhenology = UUID.fromString("a7786d3e-7c58-4141-8416-346d4c80c4a2");
564
	private static final UUID uuidOccurrence = UUID.fromString("5deff505-1a32-4817-9a74-50e6936fd630");
565
	private static final UUID uuidCitation = UUID.fromString("99b2842f-9aa7-42fa-bd5f-7285311e0101");
566 892efc69 Andreas Kohlbecker
	private static final UUID uuidAdditionalPublication = UUID.fromString("2c355c16-cb04-4858-92bf-8da8d56dea95");
567 dc115dfc Andreas Müller
	private static final UUID uuidUses = UUID.fromString("e5374d39-b210-47c7-bec1-bee05b5f1cb6");
568
	private static final UUID uuidConservation = UUID.fromString("4518fc20-2492-47de-b345-777d2b83c9cf");
569
	private static final UUID uuidCultivation = UUID.fromString("e28965b2-a367-48c5-b954-8afc8ac2c69b");
570
	private static final UUID uuidIntroduction = UUID.fromString("e75255ca-8ff4-4905-baad-f842927fe1d3");
571
	private static final UUID uuidDiscussion = UUID.fromString("d3c4cbb6-0025-4322-886b-cd0156753a25");
572 6986dfa3 Andreas Müller
	private static final UUID uuidImage = UUID.fromString("84193b2c-327f-4cce-90ef-c8da18fd5bb5");
573 459f7cf1 Andreas Müller
	private static final UUID uuidAnatomy = UUID.fromString("94213b2c-e67a-4d37-25ef-e8d316edfba1");
574 7ac2e775 Katja Luther
	private static final UUID uuidHostPlant = UUID.fromString("6e9de1d5-05f0-40d5-8786-2fe30d0d894d");
575
	private static final UUID uuidPathogenAgent = UUID.fromString("002d05f2-fd72-49f1-ba4d-196cf09240b5");
576 1412a4c4 Katja Luther
	private static final UUID uuidIndividualsAssociation = UUID.fromString("e2308f37-ddc5-447d-b483-5e2171dd85fd");
577 7ddf740a Katja Luther
	private static final UUID uuidSpecimen = UUID.fromString("8200e050-d5fd-4cac-8a76-4b47afb13809");
578
	private static final UUID uuidObservation = UUID.fromString("f59e747d-0b4f-4bf7-b69a-cbd50bc78595");
579 ca8ee70a Andreas Müller
	private static final UUID uuidStatus = UUID.fromString("86d40635-2a63-4ad6-be75-9faa4a6a57fb");
580
	private static final UUID uuidSystematics = UUID.fromString("bd9aca17-cd0e-4418-a3a1-1a4b80dbc162");
581 df13735b a.theys
	private static final UUID uuidUseRecord = UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599");
582 8ba55ff3 Patric Plitzner
583
	/**
584 4daf2f37 m.geoffroy
	 * Creates and returns a new feature instance on the basis of a given string
585
	 * list (containing an UUID, an URI, a label and a description) and a given
586
	 * {@link Language language} to be associated with the description. Furthermore
587
	 * the flags concerning the supported subclasses of {@link DescriptionElementBase description elements}
588
	 * are set according to a particular string belonging to the given
589
	 * string list.<BR>
590
	 * This method overrides the readCsvLine method from {@link DefinedTermBase#readCsvLine(List, Language) DefinedTermBase}.
591
	 *
592
	 * @param  csvLine	the string list with elementary information for attributes
593
	 * @param  lang		the language in which the description has been formulated
594
	 * @see     		#NewInstance(String, String, String)
595
	 */
596 1016f650 Andreas Müller
	@Override
597 9e3239f6 Andreas Müller
	public Feature readCsvLine(Class<Feature> termClass, List<String> csvLine, Map<UUID,DefinedTermBase> terms, boolean abbrevAsId) {
598 8ba55ff3 Patric Plitzner
		Feature newInstance = super.readCsvLine(termClass, csvLine, terms, abbrevAsId);
599
		String text = csvLine.get(4);
600 1016f650 Andreas Müller
		if (text != null && text.length() >= 6){
601 f6765014 ben.clark
			if ("1".equals(text.substring(0, 1))){newInstance.setSupportsTextData(true);};
602
			if ("1".equals(text.substring(1, 2))){newInstance.setSupportsQuantitativeData(true);};
603
			if ("1".equals(text.substring(2, 3))){newInstance.setSupportsDistribution(true);};
604
			if ("1".equals(text.substring(3, 4))){newInstance.setSupportsIndividualAssociation(true);};
605
			if ("1".equals(text.substring(4, 5))){newInstance.setSupportsTaxonInteraction(true);};
606
			if ("1".equals(text.substring(5, 6))){newInstance.setSupportsCommonTaxonName(true);};
607 b2231758 h.fradin
			// if ("1".equals(text.substring(6, 7))){newInstance.setSupportsCategoricalData(true);};
608 892efc69 Andreas Kohlbecker
			//there is no abbreviated label for features yet, if there is one in future we need to increment the index for supportXXX form 4 to 5
609
			newInstance.getRepresentation(Language.DEFAULT()).setAbbreviatedLabel(null);
610 1016f650 Andreas Müller
		}
611 f6765014 ben.clark
		return newInstance;
612 de3e2329 Andreas Müller
	}
613 8ba55ff3 Patric Plitzner
614 892efc69 Andreas Kohlbecker
//******************************* STATIC METHODS *****************************************
615 8ba55ff3 Patric Plitzner
616 892efc69 Andreas Kohlbecker
	protected static Feature getTermByUuid(UUID uuid){
617
		if (termMap == null){
618 8ba55ff3 Patric Plitzner
			return null;  //better return null then initialize the termMap in an unwanted way
619 892efc69 Andreas Kohlbecker
			//example for an unwanted initialization: before initializing spring you may use a static method of this class.
620
			//This would result in an default terminitialization instead of a database based
621
			// term initialization
622 8ba55ff3 Patric Plitzner
623 892efc69 Andreas Kohlbecker
//			DefaultTermInitializer vocabularyStore = new DefaultTermInitializer();
624 8ba55ff3 Patric Plitzner
//			vocabularyStore.initialize();
625 892efc69 Andreas Kohlbecker
		}
626 8ba55ff3 Patric Plitzner
			return termMap.get(uuid);
627 892efc69 Andreas Kohlbecker
	}
628 8ba55ff3 Patric Plitzner
629 4daf2f37 m.geoffroy
	/**
630
	 * Returns the "unknown" feature. This feature allows to store values of
631
	 * {@link DescriptionElementBase description elements} even if it is momentarily
632
	 * not known what they mean.
633
	 */
634 a8113d09 Andreas Müller
	public static final Feature UNKNOWN(){
635 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidUnknown);
636 a8113d09 Andreas Müller
	}
637 8ba55ff3 Patric Plitzner
638 4daf2f37 m.geoffroy
	/**
639
	 * Returns the "description" feature. This feature allows to handle global
640
	 * {@link DescriptionElementBase description elements} for a global {@link DescriptionBase description}.<BR>
641 8ba55ff3 Patric Plitzner
	 * The "description" feature is the highest level feature.
642 4daf2f37 m.geoffroy
	 */
643 de3e2329 Andreas Müller
	public static final Feature DESCRIPTION(){
644 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidDescription);
645 de3e2329 Andreas Müller
	}
646
647 4daf2f37 m.geoffroy
	/**
648
	 * Returns the "distribution" feature. This feature allows to handle only
649
	 * {@link Distribution distributions}.
650 8ba55ff3 Patric Plitzner
	 *
651 4daf2f37 m.geoffroy
	 * @see	#isSupportsDistribution()
652
	 */
653 ea2896ba m.geoffroy
	public static final Feature DISTRIBUTION(){
654 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidDistribution);
655 9479da48 Andreas Müller
	}
656
657 4daf2f37 m.geoffroy
	/**
658
	 * Returns the "discussion" feature. This feature can only be described
659
	 * with {@link TextData text data}.
660 8ba55ff3 Patric Plitzner
	 *
661 4daf2f37 m.geoffroy
	 * @see	#isSupportsTextData()
662
	 */
663 dc115dfc Andreas Müller
	public static final Feature DISCUSSION(){
664 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidDiscussion);
665 dc115dfc Andreas Müller
	}
666 8ba55ff3 Patric Plitzner
667 4daf2f37 m.geoffroy
	/**
668
	 * Returns the "ecology" feature. This feature only applies
669
	 * to {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.<BR>
670
	 * The "ecology" feature generalizes all other possible features concerning
671
	 * ecological matters.
672
	 */
673 de3e2329 Andreas Müller
	public static final Feature ECOLOGY(){
674 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidEcology);
675 95742cf8 Andreas Müller
	}
676 8ba55ff3 Patric Plitzner
677 95742cf8 Andreas Müller
	/**
678
	 * Returns the "habitat" feature. This feature only applies
679
	 * to {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.<BR>
680
	 * The "habitat" feature generalizes all other possible features concerning
681
	 * habitat matters.
682
	 */
683
	public static final Feature HABITAT(){
684
		return getTermByUuid(uuidHabitat);
685
	}
686
687 8ba55ff3 Patric Plitzner
688 95742cf8 Andreas Müller
	/**
689
	 * Returns the "habitat & ecology" feature. This feature only applies
690
	 * to {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.<BR>
691
	 * The "habitat & ecology" feature generalizes all other possible features concerning
692
	 * habitat and ecology matters.
693
	 */
694
	public static final Feature HABITAT_ECOLOGY(){
695
		return getTermByUuid(uuidHabitatAndEcology);
696
	}
697
698 4daf2f37 m.geoffroy
	/**
699
	 * Returns the "biology_ecology" feature. This feature only applies
700
	 * to {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.<BR>
701
	 * The "biology_ecology" feature generalizes all possible features concerning
702
	 * biological aspects of ecological matters.
703 8ba55ff3 Patric Plitzner
	 *
704 4daf2f37 m.geoffroy
	 * @see #ECOLOGY()
705
	 */
706 de3e2329 Andreas Müller
	public static final Feature BIOLOGY_ECOLOGY(){
707 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidBiologyEcology);
708 de3e2329 Andreas Müller
	}
709 95742cf8 Andreas Müller
710
	/**
711
	 * Returns the "chromosome number" feature. This feature only applies
712
	 * to {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.<BR>
713
	 */
714
	public static final Feature CHROMOSOME_NUMBER(){
715
		return getTermByUuid(uuidChromosomeNumber);
716
	}
717
718 8ba55ff3 Patric Plitzner
719 4daf2f37 m.geoffroy
	/**
720
	 * Returns the "key" feature. This feature is the "upper" feature generalizing
721
	 * all features being used within an identification key.
722
	 */
723 de3e2329 Andreas Müller
	public static final Feature KEY(){
724 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidKey);
725 8ba55ff3 Patric Plitzner
	}
726
727
728 4daf2f37 m.geoffroy
	/**
729
	 * Returns the "materials_examined" feature. This feature can only be described
730
	 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}
731
	 * mentioning which material has been examined in order to accomplish
732
	 * the description. This feature applies only to
733
	 * {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.
734
	 */
735 de3e2329 Andreas Müller
	public static final Feature MATERIALS_EXAMINED(){
736 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidMaterialsExamined);
737 de3e2329 Andreas Müller
	}
738 8ba55ff3 Patric Plitzner
739 4daf2f37 m.geoffroy
	/**
740
	 * Returns the "materials_methods" feature. This feature can only be described
741
	 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}
742
	 * mentioning which methods have been adopted to analyze the material in
743
	 * order to accomplish the description. This feature applies only to
744
	 * {@link SpecimenDescription specimen descriptions} or to {@link TaxonDescription taxon descriptions}.
745
	 */
746 de3e2329 Andreas Müller
	public static final Feature MATERIALS_METHODS(){
747 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidMaterialsMethods);
748 de3e2329 Andreas Müller
	}
749 8ba55ff3 Patric Plitzner
750 4daf2f37 m.geoffroy
	/**
751
	 * Returns the "etymology" feature. This feature can only be described
752
	 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}
753
	 * giving some information about the history of the taxon name. This feature applies only to
754
	 * {@link TaxonNameDescription taxon name descriptions}.
755
	 */
756 de3e2329 Andreas Müller
	public static final Feature ETYMOLOGY(){
757 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidEtymology);
758 de3e2329 Andreas Müller
	}
759 8ba55ff3 Patric Plitzner
760 4daf2f37 m.geoffroy
	/**
761
	 * Returns the "diagnosis" feature. This feature can only be described
762
	 * with {@link TextData text data} or eventually with {@link CategoricalData categorical data}.
763
	 * This feature applies only to {@link SpecimenDescription specimen descriptions} or to
764
	 * {@link TaxonDescription taxon descriptions}.
765
	 */
766 de3e2329 Andreas Müller
	public static final Feature DIAGNOSIS(){
767 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidDiagnosis);
768 de3e2329 Andreas Müller
	}
769 dc115dfc Andreas Müller
770 8ba55ff3 Patric Plitzner
771 4daf2f37 m.geoffroy
	/**
772
	 * Returns the "introduction" feature. This feature can only be described
773
	 * with {@link TextData text data}.
774 8ba55ff3 Patric Plitzner
	 *
775 4daf2f37 m.geoffroy
	 * @see	#isSupportsTextData()
776
	 */
777 dc115dfc Andreas Müller
	public static final Feature INTRODUCTION(){
778 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidIntroduction);
779 dc115dfc Andreas Müller
	}
780
781 4daf2f37 m.geoffroy
	/**
782
	 * Returns the "protologue" feature. This feature can only be described
783 8ba55ff3 Patric Plitzner
	 * with {@link TextData text data} reproducing the content of the protologue
784 4daf2f37 m.geoffroy
	 * (or some information about it) of the taxon name. This feature applies only to
785
	 * {@link TaxonNameDescription taxon name descriptions}.
786 8ba55ff3 Patric Plitzner
	 *
787 4daf2f37 m.geoffroy
	 * @see	#isSupportsTextData()
788 04bf71a9 Katja Luther
	 */
789 892efc69 Andreas Kohlbecker
	public static final Feature PROTOLOGUE(){
790
		return getTermByUuid(uuidProtologue);
791 76f719a7 Andreas Müller
	}
792 8ba55ff3 Patric Plitzner
793 4daf2f37 m.geoffroy
	/**
794
	 * Returns the "common_name" feature. This feature allows to handle only
795
	 * {@link CommonTaxonName common names}.
796 8ba55ff3 Patric Plitzner
	 *
797 4daf2f37 m.geoffroy
	 * @see	#isSupportsCommonTaxonName()
798
	 */
799 dfa65fb3 Andreas Müller
	public static final Feature COMMON_NAME(){
800 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidCommonName);
801 dfa65fb3 Andreas Müller
	}
802 8ba55ff3 Patric Plitzner
803 4daf2f37 m.geoffroy
	/**
804
	 * Returns the "phenology" feature. This feature can only be described
805
	 * with {@link CategoricalData categorical data} or eventually with {@link TextData text data}
806
	 * containing information time about recurring natural phenomena.
807
	 * This feature only applies to {@link TaxonDescription taxon descriptions}.<BR>
808
	 * The "phenology" feature generalizes all other possible features
809
	 * concerning time information about particular natural phenomena
810
	 * (such as "first flight of butterflies").
811
	 */
812 6b8f5129 Andreas Müller
	public static final Feature PHENOLOGY(){
813 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidPhenology);
814 6b8f5129 Andreas Müller
	}
815 de3e2329 Andreas Müller
816 4daf2f37 m.geoffroy
	/**
817
	 * Returns the "occurrence" feature.
818
	 */
819 6b8f5129 Andreas Müller
	public static final Feature OCCURRENCE(){
820 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidOccurrence);
821 6b8f5129 Andreas Müller
	}
822 459f7cf1 Andreas Müller
823
	/**
824
	 * Returns the "anatomy" feature.
825
	 */
826
	public static final Feature ANATOMY(){
827 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidAnatomy);
828 459f7cf1 Andreas Müller
	}
829 7ac2e775 Katja Luther
	/**
830
	 * Returns the "hostplant" feature.
831
	 */
832
	public static final Feature HOSTPLANT(){
833 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidHostPlant);
834 7ac2e775 Katja Luther
	}
835
	/**
836
	 * Returns the "pathogen agent" feature.
837
	 */
838
	public static final Feature PATHOGEN_AGENT(){
839 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidPathogenAgent);
840 7ac2e775 Katja Luther
	}
841
842 4daf2f37 m.geoffroy
	/**
843
	 * Returns the "citation" feature. This feature can only be described
844
	 * with {@link TextData text data}.
845 8ba55ff3 Patric Plitzner
	 *
846 4daf2f37 m.geoffroy
	 * @see	#isSupportsTextData()
847
	 */
848 6b8f5129 Andreas Müller
	public static final Feature CITATION(){
849 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidCitation);
850 6b8f5129 Andreas Müller
	}
851 8ba55ff3 Patric Plitzner
852 4daf2f37 m.geoffroy
	/**
853
	 * Returns the "additional_publication" feature. This feature can only be
854
	 * described with {@link TextData text data} with information about a
855
	 * publication where a {@link TaxonNameBase taxon name} has also been published
856
	 * but which is not the {@link TaxonNameBase#getNomenclaturalReference() nomenclatural reference}.
857
	 * This feature applies only to {@link TaxonNameDescription taxon name descriptions}.
858 8ba55ff3 Patric Plitzner
	 *
859 4daf2f37 m.geoffroy
	 * @see	#isSupportsTextData()
860 754001bc Katja Luther
	 */
861 22b75e84 Andreas Müller
	public static final Feature ADDITIONAL_PUBLICATION(){
862 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidAdditionalPublication);
863 22b75e84 Andreas Müller
	}
864 8ba55ff3 Patric Plitzner
865
866 4daf2f37 m.geoffroy
	/**
867
	 * Returns the "uses" feature. This feature only applies
868
	 * to {@link TaxonDescription taxon descriptions}.<BR>
869
	 * The "uses" feature generalizes all other possible features concerning
870
	 * particular uses (for instance "industrial use of seeds").
871
	 */
872 dc115dfc Andreas Müller
	public static final Feature USES(){
873 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidUses);
874 dc115dfc Andreas Müller
	}
875 8ba55ff3 Patric Plitzner
876 df13735b a.theys
	public static final Feature USERECORD(){
877
		return getTermByUuid(uuidUseRecord);
878
	}
879 8ba55ff3 Patric Plitzner
880
881 4daf2f37 m.geoffroy
	/**
882
	 * Returns the "conservation" feature. This feature only applies
883
	 * to {@link SpecimenDescription specimen descriptions} and generalizes
884
	 * methods and conditions for the conservation of {@link Specimen specimens}.<BR>
885
	 */
886 dc115dfc Andreas Müller
	public static final Feature CONSERVATION(){
887 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidConservation);
888 dc115dfc Andreas Müller
	}
889 8ba55ff3 Patric Plitzner
890
891 4daf2f37 m.geoffroy
	/**
892
	 * Returns the "cultivation" feature.
893
	 */
894 dc115dfc Andreas Müller
	public static final Feature CULTIVATION(){
895 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidCultivation);
896 dc115dfc Andreas Müller
	}
897 8ba55ff3 Patric Plitzner
898
899 6986dfa3 Andreas Müller
	/**
900 892efc69 Andreas Kohlbecker
	 * Returns the "image" feature.
901 6986dfa3 Andreas Müller
	 */
902
	public static final Feature IMAGE(){
903 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidImage);
904 6986dfa3 Andreas Müller
	}
905 8ba55ff3 Patric Plitzner
906 1412a4c4 Katja Luther
	/**
907
	 * Returns the "individuals association" feature.
908
	 */
909
	public static final Feature INDIVIDUALS_ASSOCIATION(){
910 892efc69 Andreas Kohlbecker
		Feature individuals_association =  getTermByUuid(uuidIndividualsAssociation);
911 064e68ad Katja Luther
		Set<Feature> generalizationOf = new HashSet<Feature>();
912
		generalizationOf.add(SPECIMEN());
913
		generalizationOf.add(OBSERVATION());
914
		individuals_association.setGeneralizationOf(generalizationOf);
915
		return individuals_association;
916 8ba55ff3 Patric Plitzner
917 1412a4c4 Katja Luther
	}
918 8ba55ff3 Patric Plitzner
919 7ddf740a Katja Luther
	public static final Feature SPECIMEN(){
920 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidSpecimen);
921 7ddf740a Katja Luther
	}
922 8ba55ff3 Patric Plitzner
923 7ddf740a Katja Luther
	public static final Feature OBSERVATION(){
924 892efc69 Andreas Kohlbecker
		return getTermByUuid(uuidObservation);
925 7ddf740a Katja Luther
	}
926 ca8ee70a Andreas Müller
927
	/**
928
	 * The status of a taxon. Usually the status should be determined within a {@link Distribution distribution}.
929
	 * If this is not possible for some reason (e.g. the area is not well defined) the status feature
930
	 * may be used.
931
	 * @return
932
	 */
933
	public static final Feature STATUS(){
934
		return getTermByUuid(uuidStatus);
935
	}
936
937
	public static final Feature SYSTEMATICS(){
938
		return getTermByUuid(uuidSystematics);
939
	}
940 8ba55ff3 Patric Plitzner
941 4daf2f37 m.geoffroy
	/**
942
	 * Returns the "hybrid_parent" feature. This feature can only be used
943
	 * by {@link TaxonInteraction taxon interactions}.<BR>
944
	 * <P>
945
	 * Note: It must be distinguished between hybrid relationships as
946
	 * relevant nomenclatural relationships between {@link BotanicalName plant names}
947
	 * on the one side and the biological relation between two {@link Taxon taxa}
948 8ba55ff3 Patric Plitzner
	 * as it is here the case on the other one.
949
	 *
950 4daf2f37 m.geoffroy
	 * @see	#isSupportsTaxonInteraction()
951
	 * @see	HybridRelationshipType
952
	 */
953 ea2896ba m.geoffroy
	public static final Feature HYBRID_PARENT(){
954 46170dab Andreas Müller
		//TODO
955
		logger.warn("HYBRID_PARENT not yet implemented");
956 9479da48 Andreas Müller
		return null;
957
	}
958
959 f6765014 ben.clark
	@Override
960
	protected void setDefaultTerms(TermVocabulary<Feature> termVocabulary) {
961 892efc69 Andreas Kohlbecker
		if (termMap == null){  //needed because there are multiple feature vocabularies
962
			termMap = new HashMap<UUID, Feature>();
963
		}
964
		for (Feature term : termVocabulary.getTerms()){
965 8ba55ff3 Patric Plitzner
			termMap.put(term.getUuid(), term);
966 892efc69 Andreas Kohlbecker
		}
967 f6765014 ben.clark
	}
968
969 9479da48 Andreas Müller
}