Project

General

Profile

Download (3.35 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

    
13
import eu.etaxonomy.cdm.model.common.VersionableEntity;
14
import org.apache.log4j.Logger;
15

    
16
import java.util.*;
17

    
18
import javax.persistence.*;
19

    
20
/**
21
 * This class represents the assignment of numerical values to {@link Feature features}
22
 * corresponding to {@link QuantitativeData quantitative data}. A statistical measurement
23
 * value instance constitutes an atomized part of an information piece
24
 * (quantitative data) so that several statistical measurement value instances
25
 * may belong to one quantitative data instance.
26
 * <P>
27
 * This class corresponds to CharacterMeasureDataType according
28
 * to the SDD schema.
29
 * 
30
 * @author m.doering
31
 * @version 1.0
32
 * @created 08-Nov-2007 13:06:54
33
 */
34
@Entity
35
public class StatisticalMeasurementValue extends VersionableEntity {
36
	static Logger logger = Logger.getLogger(StatisticalMeasurementValue.class);
37
	private float value;
38
	private Set<Modifier> modifiers = new HashSet();
39
	private StatisticalMeasure type;
40

    
41

    
42
	/** 
43
	 * Class constructor: creates a new empty statistical measurement value
44
	 * instance.
45
	 */
46
	protected StatisticalMeasurementValue(){
47
		super();
48
	}
49
	
50
	/** 
51
	 * Creates a new empty statistical measurement value instance.
52
	 */
53
	public static StatisticalMeasurementValue NewInstance(){
54
		return new StatisticalMeasurementValue();
55
	}
56
	
57
	/** 
58
	 * Returns the type of {@link StatisticalMeasure statistical measure} used in
59
	 * <i>this</i> statistical measurement value.
60
	 */
61
	@ManyToOne
62
	public StatisticalMeasure getType(){
63
		return this.type;
64
	}
65
	/** 
66
	 * @see	#getType()
67
	 */
68
	public void setType(StatisticalMeasure type){
69
		this.type = type;
70
	}
71

    
72

    
73
	/** 
74
	 * Returns the numerical value used to describe the {@link Feature feature}
75
	 * corresponding to the {@link QuantitativeData quantitative data} <i>this</i>
76
	 * statistical measurement value belongs to.
77
	 */
78
	public float getValue(){
79
		return this.value;
80
	}
81
	/** 
82
	 * @see	#getValue()
83
	 */
84
	public void setValue(float value){
85
		this.value = value;
86
	}
87
	
88
	
89
	/** 
90
	 * Returns the set of {@link Modifier modifiers} used to qualify the validity
91
	 * or probability of <i>this</i> statistical measurement value.
92
	 * This is only metainformation.
93
	 */
94
	@OneToMany
95
	public Set<Modifier> getModifiers() {
96
		return modifiers;
97
	}
98
	/**
99
	 * @see	#getModifiers() 
100
	 */
101
	protected void setModifiers(Set<Modifier> modifiers) {
102
		this.modifiers = modifiers;
103
	}
104
	/**
105
	 * Adds a {@link Modifier modifier} to the set of {@link #getModifiers() modifiers}
106
	 * used to qualify the validity of <i>this</i> statistical measurement value.
107
	 * 
108
	 * @param modifier	the modifier to be added to <i>this</i> statistical measurement value
109
	 * @see    	   		#getModifiers()
110
	 */
111
	public void addModifier(Modifier modifier) {
112
		this.modifiers.add(modifier);
113
	}
114
	/** 
115
	 * Removes one element from the set of {@link #getModifiers() modifiers}
116
	 * used to qualify the validity of <i>this</i> statistical measurement value.
117
	 *
118
	 * @param  modifier	the modifier which should be removed
119
	 * @see     		#getModifiers()
120
	 * @see     		#addModifier(Modifier)
121
	 */
122
	public void removeModifier(Modifier modifier) {
123
		this.modifiers.remove(modifier);
124
	}
125

    
126
}
(24-24/30)