Project

General

Profile

Download (5.58 KB) Statistics
| Branch: | Tag: | Revision:
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
import org.hibernate.search.annotations.Indexed;
23

    
24
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
25
import eu.etaxonomy.cdm.model.common.Language;
26
import eu.etaxonomy.cdm.model.common.TermVocabulary;
27

    
28
/**
29
/**
30
 * This class represents terms describing different statistical measures (such
31
 * as "sample size", "minimum" or "average") for {@link Feature features} that can be
32
 * described with numerical values (like for instance weights or temperature).
33
 * 
34
 * @author m.doering
35
 * @version 1.0
36
 * @created 08-Nov-2007 13:06:54
37
 */
38
@XmlAccessorType(XmlAccessType.FIELD)
39
@XmlType(name = "StatisticalMeasure")
40
@XmlRootElement(name = "StatisticalMeasure")
41
@Entity
42
@Indexed(index = "eu.etaxonomy.cdm.model.common.DefinedTermBase")
43
@Audited
44
public class StatisticalMeasure extends DefinedTermBase<StatisticalMeasure> {
45
	private static final long serialVersionUID = 9168097283660941430L;
46
	@SuppressWarnings("unused")
47
	private static final Logger logger = Logger.getLogger(StatisticalMeasure.class);
48
	
49
	private static final UUID uuidMin = UUID.fromString("2c8b42e5-154c-42bd-a301-03b483275dd6");
50
	private static final UUID uuidMax = UUID.fromString("8955815b-7d21-4149-b1b7-d37af3c2046c");
51
	private static final UUID uuidAverage = UUID.fromString("264c3979-d551-4795-9e25-24c6b533fbb1");
52
	private static final UUID uuidSampleSize = UUID.fromString("571f86ca-a44c-4484-9981-11fd82138a7a");
53
	private static final UUID uuidVariance = UUID.fromString("4d22cf5e-89ff-4de3-a9ae-12dbeda3faba");
54
	private static final UUID uuidTypicalLowerBoundary = UUID.fromString("8372a89a-35ad-4755-a881-7edae6c37c8f");
55
	private static final UUID uuidTypicalUpperBoundary = UUID.fromString("9eff88ba-b8e7-4631-9e55-a50bd16ba79d");
56
	private static final UUID uuidStandardDeviation = UUID.fromString("9ee4397e-3496-4fe1-9114-afc7d7bdc652");
57
	private static StatisticalMeasure STANDARD_DEVIATION;
58
	private static StatisticalMeasure TYPICAL_UPPER_BOUNDARY;
59
	private static StatisticalMeasure TYPICAL_LOWER_BOUNDARY;
60
	private static StatisticalMeasure VARIANCE;
61
	private static StatisticalMeasure SAMPLE_SIZE;
62
	private static StatisticalMeasure AVERAGE;
63
	private static StatisticalMeasure MAX;
64
	private static StatisticalMeasure MIN;
65

    
66
	// ************* CONSTRUCTORS *************/	
67
	/** 
68
	 * Class constructor: creates a new empty statistical measure instance.
69
	 * 
70
	 * @see #StatisticalMeasure(String, String, String)
71
	 */
72
	public StatisticalMeasure() {
73
	}
74
	public StatisticalMeasure(String term, String label, String labelAbbrev) {
75
		super(term, label, labelAbbrev);
76
	}
77

    
78
	//********* METHODS **************************************/
79
	/** 
80
	 * Creates a new empty statistical measure instance.
81
	 * 
82
	 * @see #NewInstance(String, String, String)
83
	 */
84
	public static StatisticalMeasure NewInstance(){
85
		return new StatisticalMeasure();
86
	}
87
	/** 
88
	 * Creates a new statistical measure instance with a description
89
	 * (in the {@link Language#DEFAULT() default language}), a label and a label abbreviation.
90
	 * 
91
	 * @param	term  		 the string (in the default language) describing the
92
	 * 						 new statistical measure to be created 
93
	 * @param	label  		 the string identifying the new statistical measure
94
	 * 						 to be created
95
	 * @param	labelAbbrev  the string identifying (in abbreviated form) the
96
	 * 						 new statistical measure to be created
97
	 * @see 				 #NewInstance()
98
	 */
99
	public static StatisticalMeasure NewInstance(String term, String label, String labelAbbrev){
100
		return new StatisticalMeasure(term, label, labelAbbrev);
101
	}	
102

    
103
	public static final StatisticalMeasure MIN(){
104
		return MIN;
105
	}
106

    
107
	public static final StatisticalMeasure MAX(){
108
		return MAX;
109
	}
110

    
111
	public static final StatisticalMeasure AVERAGE(){
112
		return AVERAGE;
113
	}
114

    
115
	public static final StatisticalMeasure SAMPLE_SIZE(){
116
		return SAMPLE_SIZE;
117
	}
118

    
119
	public static final StatisticalMeasure VARIANCE(){
120
		return VARIANCE;
121
	}
122

    
123
	public static final StatisticalMeasure TYPICAL_LOWER_BOUNDARY(){
124
		return TYPICAL_LOWER_BOUNDARY;
125
	}
126

    
127
	public static final StatisticalMeasure TYPICAL_UPPER_BOUNDARY(){
128
		return TYPICAL_UPPER_BOUNDARY;
129
	}
130

    
131
	public static final StatisticalMeasure STANDARD_DEVIATION(){
132
		return STANDARD_DEVIATION;
133
	}
134
	@Override
135
	protected void setDefaultTerms(TermVocabulary<StatisticalMeasure> termVocabulary) {
136
		StatisticalMeasure.AVERAGE = termVocabulary.findTermByUuid(StatisticalMeasure.uuidAverage);
137
		StatisticalMeasure.MAX = termVocabulary.findTermByUuid(StatisticalMeasure.uuidMax);
138
		StatisticalMeasure.MIN = termVocabulary.findTermByUuid(StatisticalMeasure.uuidMin);
139
		StatisticalMeasure.SAMPLE_SIZE = termVocabulary.findTermByUuid(StatisticalMeasure.uuidSampleSize);
140
		StatisticalMeasure.STANDARD_DEVIATION = termVocabulary.findTermByUuid(StatisticalMeasure.uuidStandardDeviation);
141
		StatisticalMeasure.TYPICAL_LOWER_BOUNDARY = termVocabulary.findTermByUuid(StatisticalMeasure.uuidTypicalLowerBoundary);
142
		StatisticalMeasure.TYPICAL_UPPER_BOUNDARY = termVocabulary.findTermByUuid(StatisticalMeasure.uuidTypicalUpperBoundary);
143
		StatisticalMeasure.VARIANCE = termVocabulary.findTermByUuid(StatisticalMeasure.uuidVariance);
144
	}
145
	
146
}
(27-27/36)