Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoad.java @ 6392:9a0f8d532797
Load sedimentload fraction with sedimentload factory and add new facets to artifact.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 21 Jun 2013 15:35:44 +0200 |
parents | 8d6f23243d1d |
children | e6a8255d0764 |
comparison
equal
deleted
inserted
replaced
6391:ec537afacac2 | 6392:9a0f8d532797 |
---|---|
22 { | 22 { |
23 protected String description; | 23 protected String description; |
24 protected Date start; | 24 protected Date start; |
25 protected Date end; | 25 protected Date end; |
26 protected boolean isEpoch; | 26 protected boolean isEpoch; |
27 protected String unit; | |
27 | 28 |
28 protected HashMap<Double, SedimentLoadFraction> kms; | 29 protected HashMap<Double, SedimentLoadFraction> kms; |
29 | 30 |
30 public SedimentLoad() { | 31 public SedimentLoad() { |
31 kms = new HashMap<Double, SedimentLoadFraction>(); | 32 kms = new HashMap<Double, SedimentLoadFraction>(); |
33 | 34 |
34 public SedimentLoad( | 35 public SedimentLoad( |
35 String description, | 36 String description, |
36 Date start, | 37 Date start, |
37 Date end, | 38 Date end, |
38 boolean isEpoch | 39 boolean isEpoch, |
40 String unit | |
39 ) { | 41 ) { |
40 this(); | 42 this(); |
41 this.description = description; | 43 this.description = description; |
42 this.start = start; | 44 this.start = start; |
43 this.end = end; | 45 this.end = end; |
44 this.isEpoch = isEpoch; | 46 this.isEpoch = isEpoch; |
47 this.unit = unit; | |
45 } | 48 } |
46 | 49 |
47 public String getDescription() { | 50 public String getDescription() { |
48 return description; | 51 return description; |
49 } | 52 } |
190 f.setTotalRange(range); | 193 f.setTotalRange(range); |
191 kms.put(km, f); | 194 kms.put(km, f); |
192 } | 195 } |
193 } | 196 } |
194 | 197 |
198 public void setUnknown(double km, double unknown, Range range) { | |
199 if (kms.containsKey(km)) { | |
200 kms.get(km).setUnknown(unknown); | |
201 kms.get(km).setUnknownRange(range); | |
202 } | |
203 else { | |
204 SedimentLoadFraction f = new SedimentLoadFraction(); | |
205 f.setUnknown(unknown); | |
206 f.setUnknownRange(range); | |
207 kms.put(km, f); | |
208 } | |
209 } | |
210 | |
211 public String getUnit() { | |
212 return unit; | |
213 } | |
214 | |
215 public void setUnit(String unit) { | |
216 this.unit = unit; | |
217 } | |
218 | |
195 public boolean hasCoarse() { | 219 public boolean hasCoarse() { |
196 for (SedimentLoadFraction slf : kms.values()) { | 220 for (SedimentLoadFraction slf : kms.values()) { |
197 if (slf.getCoarse() > 0d) { | 221 if (slf.getCoarse() > 0d) { |
198 return true; | 222 return true; |
199 } | 223 } |