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
|
import java.util.UUID;
|
13
|
|
14
|
import javax.persistence.Entity;
|
15
|
import javax.xml.bind.annotation.XmlAccessType;
|
16
|
import javax.xml.bind.annotation.XmlAccessorType;
|
17
|
import javax.xml.bind.annotation.XmlRootElement;
|
18
|
import javax.xml.bind.annotation.XmlType;
|
19
|
|
20
|
import org.apache.log4j.Logger;
|
21
|
import org.hibernate.envers.Audited;
|
22
|
|
23
|
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
|
24
|
import eu.etaxonomy.cdm.model.common.Language;
|
25
|
import eu.etaxonomy.cdm.model.common.TermVocabulary;
|
26
|
|
27
|
/**
|
28
|
/**
|
29
|
* This class represents terms describing different statistical measures (such
|
30
|
* as "sample size", "minimum" or "average") for {@link Feature features} that can be
|
31
|
* described with numerical values (like for instance weights or temperature).
|
32
|
*
|
33
|
* @author m.doering
|
34
|
* @version 1.0
|
35
|
* @created 08-Nov-2007 13:06:54
|
36
|
*/
|
37
|
@XmlAccessorType(XmlAccessType.FIELD)
|
38
|
@XmlType(name = "StatisticalMeasure")
|
39
|
@XmlRootElement(name = "StatisticalMeasure")
|
40
|
@Entity
|
41
|
@Audited
|
42
|
public class StatisticalMeasure extends DefinedTermBase<StatisticalMeasure> {
|
43
|
private static final long serialVersionUID = 9168097283660941430L;
|
44
|
@SuppressWarnings("unused")
|
45
|
private static final Logger logger = Logger.getLogger(StatisticalMeasure.class);
|
46
|
|
47
|
private static final UUID uuidMin = UUID.fromString("2c8b42e5-154c-42bd-a301-03b483275dd6");
|
48
|
private static final UUID uuidMax = UUID.fromString("8955815b-7d21-4149-b1b7-d37af3c2046c");
|
49
|
private static final UUID uuidAverage = UUID.fromString("264c3979-d551-4795-9e25-24c6b533fbb1");
|
50
|
private static final UUID uuidSampleSize = UUID.fromString("571f86ca-a44c-4484-9981-11fd82138a7a");
|
51
|
private static final UUID uuidVariance = UUID.fromString("4d22cf5e-89ff-4de3-a9ae-12dbeda3faba");
|
52
|
private static final UUID uuidTypicalLowerBoundary = UUID.fromString("8372a89a-35ad-4755-a881-7edae6c37c8f");
|
53
|
private static final UUID uuidTypicalUpperBoundary = UUID.fromString("9eff88ba-b8e7-4631-9e55-a50bd16ba79d");
|
54
|
private static final UUID uuidStandardDeviation = UUID.fromString("9ee4397e-3496-4fe1-9114-afc7d7bdc652");
|
55
|
private static StatisticalMeasure STANDARD_DEVIATION;
|
56
|
private static StatisticalMeasure TYPICAL_UPPER_BOUNDARY;
|
57
|
private static StatisticalMeasure TYPICAL_LOWER_BOUNDARY;
|
58
|
private static StatisticalMeasure VARIANCE;
|
59
|
private static StatisticalMeasure SAMPLE_SIZE;
|
60
|
private static StatisticalMeasure AVERAGE;
|
61
|
private static StatisticalMeasure MAX;
|
62
|
private static StatisticalMeasure MIN;
|
63
|
|
64
|
// ************* CONSTRUCTORS *************/
|
65
|
/**
|
66
|
* Class constructor: creates a new empty statistical measure instance.
|
67
|
*
|
68
|
* @see #StatisticalMeasure(String, String, String)
|
69
|
*/
|
70
|
public StatisticalMeasure() {
|
71
|
super();
|
72
|
}
|
73
|
public StatisticalMeasure(String term, String label, String labelAbbrev) {
|
74
|
super(term, label, labelAbbrev);
|
75
|
}
|
76
|
|
77
|
//********* METHODS **************************************/
|
78
|
/**
|
79
|
* Creates a new empty statistical measure instance.
|
80
|
*
|
81
|
* @see #NewInstance(String, String, String)
|
82
|
*/
|
83
|
public static StatisticalMeasure NewInstance(){
|
84
|
return new StatisticalMeasure();
|
85
|
}
|
86
|
/**
|
87
|
* Creates a new statistical measure instance with a description
|
88
|
* (in the {@link Language#DEFAULT() default language}), a label and a label abbreviation.
|
89
|
*
|
90
|
* @param term the string (in the default language) describing the
|
91
|
* new statistical measure to be created
|
92
|
* @param label the string identifying the new statistical measure
|
93
|
* to be created
|
94
|
* @param labelAbbrev the string identifying (in abbreviated form) the
|
95
|
* new statistical measure to be created
|
96
|
* @see #NewInstance()
|
97
|
*/
|
98
|
public static StatisticalMeasure NewInstance(String term, String label, String labelAbbrev){
|
99
|
return new StatisticalMeasure(term, label, labelAbbrev);
|
100
|
}
|
101
|
|
102
|
public static final StatisticalMeasure MIN(){
|
103
|
return MIN;
|
104
|
}
|
105
|
|
106
|
public static final StatisticalMeasure MAX(){
|
107
|
return MAX;
|
108
|
}
|
109
|
|
110
|
public static final StatisticalMeasure AVERAGE(){
|
111
|
return AVERAGE;
|
112
|
}
|
113
|
|
114
|
public static final StatisticalMeasure SAMPLE_SIZE(){
|
115
|
return SAMPLE_SIZE;
|
116
|
}
|
117
|
|
118
|
public static final StatisticalMeasure VARIANCE(){
|
119
|
return VARIANCE;
|
120
|
}
|
121
|
|
122
|
public static final StatisticalMeasure TYPICAL_LOWER_BOUNDARY(){
|
123
|
return TYPICAL_LOWER_BOUNDARY;
|
124
|
}
|
125
|
|
126
|
public static final StatisticalMeasure TYPICAL_UPPER_BOUNDARY(){
|
127
|
return TYPICAL_UPPER_BOUNDARY;
|
128
|
}
|
129
|
|
130
|
public static final StatisticalMeasure STANDARD_DEVIATION(){
|
131
|
return STANDARD_DEVIATION;
|
132
|
}
|
133
|
@Override
|
134
|
protected void setDefaultTerms(TermVocabulary<StatisticalMeasure> termVocabulary) {
|
135
|
StatisticalMeasure.AVERAGE = termVocabulary.findTermByUuid(StatisticalMeasure.uuidAverage);
|
136
|
StatisticalMeasure.MAX = termVocabulary.findTermByUuid(StatisticalMeasure.uuidMax);
|
137
|
StatisticalMeasure.MIN = termVocabulary.findTermByUuid(StatisticalMeasure.uuidMin);
|
138
|
StatisticalMeasure.SAMPLE_SIZE = termVocabulary.findTermByUuid(StatisticalMeasure.uuidSampleSize);
|
139
|
StatisticalMeasure.STANDARD_DEVIATION = termVocabulary.findTermByUuid(StatisticalMeasure.uuidStandardDeviation);
|
140
|
StatisticalMeasure.TYPICAL_LOWER_BOUNDARY = termVocabulary.findTermByUuid(StatisticalMeasure.uuidTypicalLowerBoundary);
|
141
|
StatisticalMeasure.TYPICAL_UPPER_BOUNDARY = termVocabulary.findTermByUuid(StatisticalMeasure.uuidTypicalUpperBoundary);
|
142
|
StatisticalMeasure.VARIANCE = termVocabulary.findTermByUuid(StatisticalMeasure.uuidVariance);
|
143
|
}
|
144
|
}
|