Load predefined terms StatisticalMeasure and DerivationEventType
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / description / StatisticalMeasure.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 import java.util.UUID;
13
14 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
15 import eu.etaxonomy.cdm.model.common.Language;
16 import eu.etaxonomy.cdm.model.common.MarkerType;
17
18 import org.apache.log4j.Logger;
19 import javax.persistence.*;
20
21 /**
22 /**
23 * This class represents terms describing different statistical measures (such
24 * as "sample size", "minimum" or "average") for {@link Feature features} that can be
25 * described with numerical values (like for instance weights or temperature).
26 *
27 * @author m.doering
28 * @version 1.0
29 * @created 08-Nov-2007 13:06:54
30 */
31 @Entity
32 public class StatisticalMeasure extends DefinedTermBase {
33
34 private static final Logger logger = Logger.getLogger(StatisticalMeasure.class);
35
36 private static final UUID uuidMin = UUID.fromString("2c8b42e5-154c-42bd-a301-03b483275dd6");
37 private static final UUID uuidMax = UUID.fromString("8955815b-7d21-4149-b1b7-d37af3c2046c");
38 private static final UUID uuidAverage = UUID.fromString("264c3979-d551-4795-9e25-24c6b533fbb1");
39 private static final UUID uuidSampleSize = UUID.fromString("571f86ca-a44c-4484-9981-11fd82138a7a");
40 private static final UUID uuidVariance = UUID.fromString("4d22cf5e-89ff-4de3-a9ae-12dbeda3faba");
41 private static final UUID uuidTypicalLowerBoundary = UUID.fromString("8372a89a-35ad-4755-a881-7edae6c37c8f");
42 private static final UUID uuidTypicalUpperBoundary = UUID.fromString("9eff88ba-b8e7-4631-9e55-a50bd16ba79d");
43
44 // ************* CONSTRUCTORS *************/
45 /**
46 * Class constructor: creates a new empty statistical measure instance.
47 *
48 * @see #StatisticalMeasure(String, String, String)
49 */
50 public StatisticalMeasure() {
51 super();
52 }
53 public StatisticalMeasure(String term, String label, String labelAbbrev) {
54 super(term, label, labelAbbrev);
55 }
56
57 //********* METHODS **************************************/
58 /**
59 * Creates a new empty statistical measure instance.
60 *
61 * @see #NewInstance(String, String, String)
62 */
63 public static StatisticalMeasure NewInstance(){
64 return new StatisticalMeasure();
65 }
66 /**
67 * Creates a new statistical measure instance with a description
68 * (in the {@link Language#DEFAULT() default language}), a label and a label abbreviation.
69 *
70 * @param term the string (in the default language) describing the
71 * new statistical measure to be created
72 * @param label the string identifying the new statistical measure
73 * to be created
74 * @param labelAbbrev the string identifying (in abbreviated form) the
75 * new statistical measure to be created
76 * @see #NewInstance()
77 */
78 public static StatisticalMeasure NewInstance(String term, String label, String labelAbbrev){
79 return new StatisticalMeasure(term, label, labelAbbrev);
80 }
81
82 public static final StatisticalMeasure getByUuid(UUID uuid){
83 return (StatisticalMeasure) findByUuid(uuid);
84 }
85
86 public static final StatisticalMeasure MIN(){
87 return getByUuid(uuidMin);
88 }
89
90 public static final StatisticalMeasure MAX(){
91 return getByUuid(uuidMax);
92 }
93
94 public static final StatisticalMeasure AVERAGE(){
95 return getByUuid(uuidAverage);
96 }
97
98 public static final StatisticalMeasure SAMPLE_SIZE(){
99 return getByUuid(uuidSampleSize);
100 }
101
102 public static final StatisticalMeasure VARIANCE(){
103 return getByUuid(uuidVariance);
104 }
105
106 public static final StatisticalMeasure TYPICAL_LOWER_BOUNDARY(){
107 return getByUuid(uuidTypicalLowerBoundary);
108 }
109
110 public static final StatisticalMeasure TYPICAL_UPPER_BOUNDARY(){
111 return getByUuid(uuidTypicalUpperBoundary);
112 }
113
114 }