(no commit message)
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / description / Feature.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9
10 package eu.etaxonomy.cdm.model.description;
11
12
13 import eu.etaxonomy.cdm.model.common.TermVocabulary;
14 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
15 import org.apache.log4j.Logger;
16
17 import java.util.*;
18
19 import javax.persistence.*;
20 import javax.xml.bind.annotation.XmlType;
21
22 /**
23 * Individual property of observed phenomena able to be described or measured.
24 * Experts do not use the word feature for the actual description but only for
25 * the property itself. Naming this class FeatureType would create confusion.
26 * NEEDS TO BE COMPLEMENTED SPM / TDWG http://rs.tdwg.
27 * org/ontology/voc/SpeciesProfileModel
28 *
29 * @author m.doering
30 * @version 1.0
31 * @created 08-Nov-2007 13:06:24
32 */
33 @XmlType(name="Feature", factoryMethod="NewInstance")
34 @Entity
35 public class Feature extends DefinedTermBase {
36 static Logger logger = Logger.getLogger(Feature.class);
37
38 private boolean supportsQuantitativeData;
39 private boolean supportsTextData;
40 private boolean supportsDistribution;
41 private boolean supportsIndividualAssociation;
42 private boolean supportsTaxonInteraction;
43 private boolean supportsCommonTaxonName;
44 private Set<TermVocabulary> recommendedModifierEnumeration = new HashSet<TermVocabulary>();
45 private Set<StatisticalMeasure> recommendedStatisticalMeasures = new HashSet<StatisticalMeasure>();
46 private Set<TermVocabulary> supportedCategoricalEnumerations = new HashSet<TermVocabulary>();
47
48 /* ***************** CONSTRUCTOR AND FACTORY METHODS **********************************/
49
50
51 public static Feature NewInstance() {
52 return new Feature();
53 }
54 public static Feature NewInstance(String term, String label, String labelAbbrev){
55 return new Feature(term, label, labelAbbrev);
56 }
57
58 /**
59 * Default Constructor
60 */
61 private Feature() {
62 super();
63 }
64
65 protected Feature(String term, String label, String labelAbbrev) {
66 super(term, label, labelAbbrev);
67 }
68
69 /* *************************************************************************************/
70 public boolean isSupportsQuantitativeData() {
71 return supportsQuantitativeData;
72 }
73
74 public void setSupportsQuantitativeData(boolean supportsQuantitativeData) {
75 this.supportsQuantitativeData = supportsQuantitativeData;
76 }
77
78 public boolean isSupportsTextData() {
79 return supportsTextData;
80 }
81
82 public void setSupportsTextData(boolean supportsTextData) {
83 this.supportsTextData = supportsTextData;
84 }
85
86 public boolean isSupportsDistribution() {
87 return supportsDistribution;
88 }
89
90 public void setSupportsDistribution(boolean supportsDistribution) {
91 this.supportsDistribution = supportsDistribution;
92 }
93
94 public boolean isSupportsIndividualAssociation() {
95 return supportsIndividualAssociation;
96 }
97
98 public void setSupportsIndividualAssociation(
99 boolean supportsIndividualAssociation) {
100 this.supportsIndividualAssociation = supportsIndividualAssociation;
101 }
102
103 public boolean isSupportsTaxonInteraction() {
104 return supportsTaxonInteraction;
105 }
106
107 public void setSupportsTaxonInteraction(boolean supportsTaxonInteraction) {
108 this.supportsTaxonInteraction = supportsTaxonInteraction;
109 }
110
111 public boolean isSupportsCommonTaxonName() {
112 return supportsCommonTaxonName;
113 }
114
115 public void setSupportsCommonTaxonName(boolean supportsCommonTaxonName) {
116 this.supportsCommonTaxonName = supportsCommonTaxonName;
117 }
118
119 @OneToMany
120 public Set<TermVocabulary> getRecommendedModifierEnumeration() {
121 return recommendedModifierEnumeration;
122 }
123
124 protected void setRecommendedModifierEnumeration(
125 Set<TermVocabulary> recommendedModifierEnumeration) {
126 this.recommendedModifierEnumeration = recommendedModifierEnumeration;
127 }
128
129 public void addRecommendedModifierEnumeration(
130 TermVocabulary recommendedModifierEnumeration) {
131 this.recommendedModifierEnumeration.add(recommendedModifierEnumeration);
132 }
133 public void removeRecommendedModifierEnumeration(
134 TermVocabulary recommendedModifierEnumeration) {
135 this.recommendedModifierEnumeration.remove(recommendedModifierEnumeration);
136 }
137
138 @OneToMany
139 public Set<StatisticalMeasure> getRecommendedStatisticalMeasures() {
140 return recommendedStatisticalMeasures;
141 }
142
143 protected void setRecommendedStatisticalMeasures(
144 Set<StatisticalMeasure> recommendedStatisticalMeasures) {
145 this.recommendedStatisticalMeasures = recommendedStatisticalMeasures;
146 }
147
148 public void addRecommendedStatisticalMeasure(
149 StatisticalMeasure recommendedStatisticalMeasure) {
150 this.recommendedStatisticalMeasures.add(recommendedStatisticalMeasure);
151 }
152 public void removeRecommendedStatisticalMeasure(
153 StatisticalMeasure recommendedStatisticalMeasure) {
154 this.recommendedStatisticalMeasures.remove(recommendedStatisticalMeasure);
155 }
156
157 @OneToMany
158 public Set<TermVocabulary> getSupportedCategoricalEnumerations() {
159 return supportedCategoricalEnumerations;
160 }
161
162 protected void setSupportedCategoricalEnumerations(
163 Set<TermVocabulary> supportedCategoricalEnumerations) {
164 this.supportedCategoricalEnumerations = supportedCategoricalEnumerations;
165 }
166 public void addSupportedCategoricalEnumeration(
167 TermVocabulary supportedCategoricalEnumeration) {
168 this.supportedCategoricalEnumerations.add(supportedCategoricalEnumeration);
169 }
170 public void removeSupportedCategoricalEnumeration(
171 TermVocabulary supportedCategoricalEnumeration) {
172 this.supportedCategoricalEnumerations.remove(supportedCategoricalEnumeration);
173 }
174
175 public static final Feature DISTRIBUTION(){
176 //TODO
177 logger.warn("DISTRIBUTION not yet implemented");
178 return null;
179 }
180
181 /**
182 * special kind of OrganismInteraction
183 */
184 public static final Feature HYBRID_PARENT(){
185 //TODO
186 logger.warn("HYBRID_PARENT not yet implemented");
187 return null;
188 }
189
190 public static final Feature COMMON_NAME(){
191 //TODO
192 logger.warn("COMMON_NAME not yet implemented");
193 return null;
194 }
195
196 }