comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/Measurement.java @ 4002:fdc6b1e64d01

Fix compiling bug
author Sascha L. Teichmann <teichmann@intevation.de>
date Mon, 01 Oct 2012 14:30:48 +0200
parents ab3a4ad82ae1
children 22abdc45869c
comparison
equal deleted inserted replaced
4001:ab3a4ad82ae1 4002:fdc6b1e64d01
18 public static final double SCALE_4 = Math.log(6.3); 18 public static final double SCALE_4 = Math.log(6.3);
19 19
20 protected Map<String, Object> data; 20 protected Map<String, Object> data;
21 21
22 protected List<Sieve> sieves; 22 protected List<Sieve> sieves;
23
24 protected SieveArray sieveArray;
23 25
24 public Measurement() { 26 public Measurement() {
25 } 27 }
26 28
27 public Measurement(Map<String, Object> data, List<Sieve> sieves) { 29 public Measurement(Map<String, Object> data, List<Sieve> sieves) {
119 * Gets the sieveArray for this instance. 121 * Gets the sieveArray for this instance.
120 * 122 *
121 * @return The sieveArray. 123 * @return The sieveArray.
122 */ 124 */
123 public SieveArray getSieveArray() { 125 public SieveArray getSieveArray() {
124 return this.sieveArray; 126 if (sieveArray == null) {
125 } 127 sieveArray = calculateSieveArray();
126 128 }
127 /** 129 return sieveArray;
128 * Gets the prev for this instance.
129 *
130 * @return The prev.
131 */
132 public Measurement getPrev() {
133 return this.prev;
134 }
135
136 /**
137 * Sets the prev for this instance.
138 *
139 * @param prev The prev.
140 */
141 public void setPrev(Measurement prev) {
142 this.prev = prev;
143 }
144
145 /**
146 * Gets the next for this instance.
147 *
148 * @return The next.
149 */
150 public Measurement getNext() {
151 return this.next;
152 }
153
154 /**
155 * Sets the next for this instance.
156 *
157 * @param next The next.
158 */
159 public void setNext(Measurement next) {
160 this.next = next;
161 } 130 }
162 131
163 protected Sieve findSieve(double diameter) { 132 protected Sieve findSieve(double diameter) {
164 for (Sieve s: sieves) { 133 for (Sieve s: sieves) {
165 if (s.matchesDiameter(diameter)) { 134 if (s.matchesDiameter(diameter)) {
208 double eightValue = ADD_8 - SCALE_8*sixValue + tenValue; 177 double eightValue = ADD_8 - SCALE_8*sixValue + tenValue;
209 double newFourValue = ADD_4 - SCALE_4*sixValue + fourValue; 178 double newFourValue = ADD_4 - SCALE_4*sixValue + fourValue;
210 179
211 sieves.add(new Sieve(8d, eightValue)); 180 sieves.add(new Sieve(8d, eightValue));
212 sieves.add(new Sieve(4d, newFourValue)); 181 sieves.add(new Sieve(4d, newFourValue));
213 } 182 }
214
215 183
216 public SieveArray calculateSieveArray() { 184 public SieveArray calculateSieveArray() {
217 185
218 SieveArray sa = new SieveArray(); 186 SieveArray sa = new SieveArray();
219 187

http://dive4elements.wald.intevation.org