1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package fr.ens.transcriptome.doelan.data;
24
25 import fr.ens.transcriptome.doelan.algorithms.QualityGlobalTest;
26 import fr.ens.transcriptome.nividic.om.BioAssay;
27
28 /***
29 * This class define a result from a QualityUnitTest
30 * @author Laurent Jourdren
31 */
32 public class QualityGlobalTestResult extends QualityTestResult {
33
34 private double threshold;
35 private double value;
36 private String unit;
37 private String thresholdEqualityType = "<";
38 private boolean percent;
39
40
41
42
43
44 /***
45 * Get the Threshold.
46 * @return Returns the threshold in percent
47 */
48 public double getThreshold() {
49 return threshold;
50 }
51
52 /***
53 * Get the value.
54 * @return Returns the value
55 */
56 public double getValue() {
57 return value;
58 }
59
60 /***
61 * Test if the value is a percentage.
62 * @return Returns the percent
63 */
64 public boolean isPercent() {
65 return percent;
66 }
67
68 /***
69 * Get the unit of the value and the threshold.
70 * @return The unit of the value and the threshold
71 */
72 public String getUnit() {
73 return this.unit;
74 }
75
76 /***
77 * Get the type of equality between the threshold and this value. For example:
78 * "=", " <", ">", " <=", ">=", "!="... Default value is " <".
79 * @return the type of equality of the parameter.
80 */
81 public String getThresholdEqualityType() {
82 return this.thresholdEqualityType;
83 }
84
85
86
87
88
89 /***
90 * Set the threshold.
91 * @param threshold The threshold to set
92 */
93 public void setThreshold(final double threshold) {
94 this.threshold = threshold;
95 }
96
97 /***
98 * Set the value.
99 * @param value The value to set
100 */
101 public void setValue(final double value) {
102 this.value = value;
103 }
104
105 /***
106 * Set if the value is a percentage.
107 * @param percent The percent to set
108 */
109 public void setPercent(final boolean percent) {
110 this.percent = percent;
111 }
112
113 /***
114 * Set the unit of the value and the threshold.
115 * @param unit Unit to set
116 */
117 public void setUnit(final String unit) {
118 this.unit = unit;
119 }
120
121 /***
122 * Set the equality type between the the threshold and its value.
123 * @param equality The equality to set.
124 */
125 public void setThresholdEqualityType(final String equality) {
126
127 if ("=".equals(equality) || "!=".equals(equality) || "<".equals(equality)
128 || "<=".equals(equality) || ">".equals(equality)
129 || ">=".equals(equality)) {
130 this.thresholdEqualityType = equality;
131 }
132 }
133
134
135
136
137
138 /***
139 * Public constructor.
140 * @param bioassay The bioassay used for the test
141 * @param test The test used
142 */
143 public QualityGlobalTestResult(final BioAssay bioassay,
144 final QualityGlobalTest test) {
145 setBioAssay(bioassay);
146 setParameters(test.getParameters());
147 setTestId(test.getId());
148 setTestType(test.aboutModule().getName());
149 setTestDescription(test.aboutModule().getShortDescription());
150 }
151
152 }