Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeRange.java @ 5795:202a73ce6704
WST-Parser: Avoid trying to set MIN_RANGE when actually no stations are given
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 23 Apr 2013 17:30:20 +0200 |
parents | f987d25627aa |
children |
rev | line source |
---|---|
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import java.util.ArrayList; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 import java.util.HashMap; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 import java.util.List; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 import java.util.Map; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 import org.apache.log4j.Logger; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 |
5335
05eeedc5b156
Doc, cosmetic and TODO fixes, renamed field in WQTimeRange.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3421
diff
changeset
|
12 /** |
05eeedc5b156
Doc, cosmetic and TODO fixes, renamed field in WQTimeRange.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3421
diff
changeset
|
13 * Gauge, km-range, main values. |
05eeedc5b156
Doc, cosmetic and TODO fixes, renamed field in WQTimeRange.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3421
diff
changeset
|
14 */ |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 public class GaugeRange |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 extends Range |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 private static Logger log = Logger.getLogger(GaugeRange.class); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 private static final class Sector implements Serializable { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 int sector; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 double value; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 Sector(int sector, double value) { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 this.sector = sector; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 this.value = value; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 } // class Sector |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 |
3421
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
31 protected String name; |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
32 |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 protected int gaugeId; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
35 /** Certain main value. */ |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 protected Map<String, Double> mainValues; |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
37 |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 protected List<Sector> sectors; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
40 |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 public GaugeRange() { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
44 |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 public GaugeRange(double start, double end, int gaugeId) { |
3421
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
46 this(start, end, null, gaugeId); |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
47 } |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
48 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
49 |
3421
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
50 public GaugeRange( |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
51 double start, |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
52 double end, |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
53 String name, |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
54 int gaugeId |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
55 ) { |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 super(start, end); |
3421
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
57 this.name = name; |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
58 this.gaugeId = gaugeId; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
59 mainValues = new HashMap<String, Double>(); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
60 sectors = new ArrayList<Sector>(3); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
61 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
62 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
63 |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
64 public void addMainValue(String label, Double value) { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
65 int idx = label.indexOf('('); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
66 if (idx >= 0) { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
67 label = label.substring(0, idx); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
68 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
69 mainValues.put(label, value); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
70 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
71 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
72 |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
73 protected Double getMainValue(String label) { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
74 Double v = mainValues.get(label); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
75 if (v == null) { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
76 log.warn("Missing main value '" |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
77 + label + "' for gauge " + gaugeId); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
78 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
79 return v; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
80 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
81 |
5344
f987d25627aa
Show some Q mainvalues in DischargeTablesOverview.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5343
diff
changeset
|
82 |
f987d25627aa
Show some Q mainvalues in DischargeTablesOverview.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5343
diff
changeset
|
83 public Map<String, Double> getMainValues() { |
f987d25627aa
Show some Q mainvalues in DischargeTablesOverview.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5343
diff
changeset
|
84 return mainValues; |
f987d25627aa
Show some Q mainvalues in DischargeTablesOverview.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5343
diff
changeset
|
85 } |
f987d25627aa
Show some Q mainvalues in DischargeTablesOverview.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5343
diff
changeset
|
86 |
f987d25627aa
Show some Q mainvalues in DischargeTablesOverview.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5343
diff
changeset
|
87 |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
88 public void buildClasses() { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
89 Double mnq = getMainValue("MNQ"); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
90 Double mq = getMainValue("MQ"); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
91 Double mhq = getMainValue("MHQ"); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
92 Double hq5 = getMainValue("HQ5"); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
93 |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
94 Double [][] pairs = { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 { mnq, mq }, |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 { mq, mhq }, |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
97 { hq5, hq5 } }; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 for (int c = 0; c < pairs.length; ++c) { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 Double [] pair = pairs[c]; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 if (pair[0] != null && pair[1] != null) { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 double value = 0.5*(pair[0] + pair[1]); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 sectors.add(new Sector(c, value)); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
105 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
106 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
107 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
108 |
3144
05a7298c4f20
Fix: add method to find discharge sector border for given river and km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3141
diff
changeset
|
109 public double getSectorBorder(int sector) { |
05a7298c4f20
Fix: add method to find discharge sector border for given river and km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3141
diff
changeset
|
110 for (Sector s: sectors) { |
05a7298c4f20
Fix: add method to find discharge sector border for given river and km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3141
diff
changeset
|
111 if (s.sector == sector) { |
05a7298c4f20
Fix: add method to find discharge sector border for given river and km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3141
diff
changeset
|
112 return s.value; |
05a7298c4f20
Fix: add method to find discharge sector border for given river and km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3141
diff
changeset
|
113 } |
05a7298c4f20
Fix: add method to find discharge sector border for given river and km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3141
diff
changeset
|
114 } |
05a7298c4f20
Fix: add method to find discharge sector border for given river and km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3141
diff
changeset
|
115 return Double.NaN; |
05a7298c4f20
Fix: add method to find discharge sector border for given river and km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3141
diff
changeset
|
116 } |
05a7298c4f20
Fix: add method to find discharge sector border for given river and km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3141
diff
changeset
|
117 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
118 |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 public int classify(double value) { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
120 for (Sector sector: sectors) { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
121 if (value < sector.value) { |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
122 return sector.sector; |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
123 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
124 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
125 return sectors.size(); |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
126 } |
3151
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
127 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
128 |
3421
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
129 public String getName() { |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
130 return name; |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
131 } |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
132 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
133 |
3421
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
134 public void setName(String name) { |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
135 this.name = name; |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
136 } |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3151
diff
changeset
|
137 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
138 |
3151
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
139 public String toString() { |
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
140 StringBuilder sb = new StringBuilder("sectors: ["); |
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
141 |
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
142 for (int i = 0, S = sectors.size(); i < S; ++i) { |
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
143 if (i > 0) sb.append(", "); |
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
144 Sector s = sectors.get(i); |
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
145 sb.append(s.sector).append(": ").append(s.value);; |
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
146 } |
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
147 |
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
148 sb.append("] mainvalues: ").append(mainValues); |
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
149 |
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
150 return sb.toString(); |
08230c76cd92
FixA: KM chart helper service: Added debug output when creating Q sector markers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3144
diff
changeset
|
151 } |
3141
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
152 } |
3582e87e9171
FixA: Made GaugeRange a top level class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
153 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |