Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/QualityMeasurements.java @ 4357:11cf29eb002c
FacetTypes: New type: exreme_wq_curve_base (for the Stuetz-Q-Poits).
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 02 Nov 2012 11:58:11 +0100 |
parents | 728ecd2afa20 |
children |
rev | line source |
---|---|
3755
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model.minfo; |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 import java.util.LinkedList; |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 |
3769
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
6 import org.apache.log4j.Logger; |
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
7 |
3755
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 public class QualityMeasurements { |
3769
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
9 private static Logger logger = Logger.getLogger(QualityMeasurements.class); |
3755
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 private List<QualityMeasurement> measurements; |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 public QualityMeasurements() { |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 } |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 public QualityMeasurements(List<QualityMeasurement> list) { |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 measurements = list; |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 } |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 public List<QualityMeasurement> getMeasurements() { |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 return measurements; |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 } |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 public List<QualityMeasurement> getMeasurements(double km) { |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 List<QualityMeasurement> res = new LinkedList<QualityMeasurement>(); |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 for (QualityMeasurement qm: measurements) { |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 if (qm.getKm() == km) { |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 res.add(qm); |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 } |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 } |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 return res; |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 } |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 |
3769
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
33 public List<Double> getKms() { |
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
34 List<Double> result = new LinkedList<Double>(); |
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
35 for (QualityMeasurement qm : measurements) { |
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
36 if (result.indexOf(qm.getKm()) < 0) { |
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
37 result.add(qm.getKm()); |
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
38 } |
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
39 } |
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
40 return result; |
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
41 } |
728ecd2afa20
Implemented bed quality calculation in minfo module.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3755
diff
changeset
|
42 |
3755
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 public void setMeasurements(List<QualityMeasurement> list) { |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 this.measurements = list; |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 } |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 public void addMeasurement(QualityMeasurement qm) { |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 this.measurements.add(qm); |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 } |
9c555ce5ca50
Data objects and factory for minfo bedquality calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 } |