Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/common/UInfoResultType.java @ 9432:d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
author | mschaefer |
---|---|
date | Mon, 20 Aug 2018 09:46:02 +0200 |
parents | bd5f5d2220fa |
children |
rev | line source |
---|---|
8996 | 1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
9328 | 10 package org.dive4elements.river.artifacts.uinfo.common; |
8996 | 11 |
12 import java.text.NumberFormat; | |
13 | |
14 import org.dive4elements.artifacts.CallContext; | |
15 import org.dive4elements.river.artifacts.common.AbstractResultType; | |
16 import org.dive4elements.river.utils.Formatter; | |
17 | |
18 /** | |
19 * @author Domenico Nardi Tironi | |
20 * | |
21 */ | |
22 public abstract class UInfoResultType extends AbstractResultType { | |
23 | |
9006 | 24 private static final long serialVersionUID = 1L; |
25 | |
9429
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
26 protected UInfoResultType(final String unit, final String csvHeader) { |
8996 | 27 super(unit, csvHeader, csvHeader); |
28 } | |
29 | |
9361
2aec052d4088
Refactoring on SalixLineCalculationResult etc., calculation using MQ etc., scenario (regional+supra) csv columns and meta data added
mschaefer
parents:
9328
diff
changeset
|
30 public static final UInfoResultType customMultiRowColSalixScenarios = new UInfoResultType(null, "uinfo.export.salix_line.csv.header.scenario") { |
9243 | 31 private static final long serialVersionUID = 1L; |
32 | |
33 @Override | |
34 public String exportValue(final CallContext context, final Object value) { | |
35 throw new UnsupportedOperationException(); | |
36 } | |
37 | |
38 @Override | |
39 protected NumberFormat createFormatter(final CallContext context) { | |
40 throw new UnsupportedOperationException(); | |
41 } | |
42 }; | |
43 | |
9361
2aec052d4088
Refactoring on SalixLineCalculationResult etc., calculation using MQ etc., scenario (regional+supra) csv columns and meta data added
mschaefer
parents:
9328
diff
changeset
|
44 public static final UInfoResultType salix_mw_mnw = new UInfoResultType(null, "uinfo.export.salix_line.csv.header.mw_mnw") { |
9243 | 45 private static final long serialVersionUID = 1L; |
46 | |
47 @Override | |
48 public String exportValue(final CallContext context, final Object value) { | |
49 final double doubleValue = asDouble(value); | |
50 return exportDoubleValue(context, doubleValue); | |
51 } | |
52 | |
53 @Override | |
54 protected NumberFormat createFormatter(final CallContext context) { | |
55 // REMARK: other modules use Formatter.getWaterlevelW(context) instead, but that format with a variable number of | |
56 // digits. | |
57 return Formatter.getSalixLine(context); | |
58 } | |
59 }; | |
60 | |
8996 | 61 public static final UInfoResultType salixline = new UInfoResultType(null, "uinfo.export.salix_line.csv.header.salix_line") { |
9006 | 62 private static final long serialVersionUID = 1L; |
63 | |
8996 | 64 @Override |
65 public String exportValue(final CallContext context, final Object value) { | |
66 final double doubleValue = asDouble(value); | |
67 return exportDoubleValue(context, doubleValue); | |
68 } | |
69 | |
70 @Override | |
71 protected NumberFormat createFormatter(final CallContext context) { | |
72 // REMARK: other modules use Formatter.getWaterlevelW(context) instead, but that format with a variable number of | |
73 // digits. | |
74 return Formatter.getSalixLine(context); | |
75 } | |
76 }; | |
77 | |
9432
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
78 public static final UInfoResultType salixw = new UInfoResultType(null, null) { |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
79 private static final long serialVersionUID = 1L; |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
80 |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
81 @Override |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
82 public String exportValue(final CallContext context, final Object value) { |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
83 throw new UnsupportedOperationException(); |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
84 } |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
85 |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
86 @Override |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
87 protected NumberFormat createFormatter(final CallContext context) { |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
88 throw new UnsupportedOperationException(); |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
89 } |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
90 }; |
d194c5b24bf8
Added bundu bzws w calculation and longitudinal sections of wspl and depth
mschaefer
parents:
9429
diff
changeset
|
91 |
9006 | 92 public static final UInfoResultType vegname = new UInfoResultType(null, "uinfo.export.csv.meta.header.veg.name") { |
93 private static final long serialVersionUID = 1L; | |
94 | |
95 @Override | |
96 public String exportValue(final CallContext context, final Object value) { | |
97 return exportStringValue(value); | |
98 } | |
99 | |
100 @Override | |
101 protected NumberFormat createFormatter(final CallContext context) { | |
102 throw new UnsupportedOperationException(); | |
103 } | |
104 }; | |
105 | |
9260 | 106 public static final UInfoResultType vegzone_color = new UInfoResultType(null, "uinfo.export.csv.meta.header.veg.color") { |
107 private static final long serialVersionUID = 1L; | |
108 | |
109 @Override | |
110 public String exportValue(final CallContext context, final Object value) { | |
111 return exportStringValue(value); | |
112 } | |
113 | |
114 @Override | |
115 protected NumberFormat createFormatter(final CallContext context) { | |
116 throw new UnsupportedOperationException(); | |
117 } | |
118 }; | |
9006 | 119 public static final UInfoResultType vegdauervon = new UInfoResultType(null, "uinfo.export.csv.meta.header.veg.dauervon") { |
120 private static final long serialVersionUID = 1L; | |
121 | |
122 @Override | |
123 public String exportValue(final CallContext context, final Object value) { | |
9101 | 124 final double doubleValue = asDouble(value); |
125 return exportDoubleValue(context, doubleValue); | |
9006 | 126 } |
127 | |
128 @Override | |
129 protected NumberFormat createFormatter(final CallContext context) { | |
130 // REMARK: other modules use Formatter.getWaterlevelW(context) instead, but that format with a variable number of | |
131 // digits. | |
132 return Formatter.getUeberflutungsdauer(context); | |
133 } | |
134 }; | |
135 | |
136 public static final UInfoResultType vegdauerbis = new UInfoResultType(null, "uinfo.export.csv.meta.header.veg.dauerbis") { | |
137 private static final long serialVersionUID = 1L; | |
138 | |
139 @Override | |
140 public String exportValue(final CallContext context, final Object value) { | |
9260 | 141 // valix hex-Check? |
142 return String.valueOf(value); | |
9006 | 143 } |
144 | |
145 @Override | |
146 protected NumberFormat createFormatter(final CallContext context) { | |
147 // REMARK: other modules use Formatter.getWaterlevelW(context) instead, but that format with a variable number of | |
148 // digits. | |
149 return Formatter.getUeberflutungsdauer(context); | |
150 } | |
151 }; | |
9429
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
152 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
153 public static final UInfoResultType waterlevelMNW = new UInfoResultType(null, null) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
154 private static final long serialVersionUID = 1L; |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
155 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
156 @Override |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
157 public String exportValue(final CallContext context, final Object value) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
158 throw new UnsupportedOperationException(); |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
159 } |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
160 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
161 @Override |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
162 protected NumberFormat createFormatter(final CallContext context) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
163 throw new UnsupportedOperationException(); |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
164 } |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
165 }; |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
166 public static final UInfoResultType waterlevelMW = new UInfoResultType(null, null) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
167 private static final long serialVersionUID = 1L; |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
168 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
169 @Override |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
170 public String exportValue(final CallContext context, final Object value) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
171 throw new UnsupportedOperationException(); |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
172 } |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
173 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
174 @Override |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
175 protected NumberFormat createFormatter(final CallContext context) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
176 throw new UnsupportedOperationException(); |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
177 } |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
178 }; |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
179 public static final UInfoResultType waterlevelMHW = new UInfoResultType(null, null) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
180 private static final long serialVersionUID = 1L; |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
181 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
182 @Override |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
183 public String exportValue(final CallContext context, final Object value) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
184 throw new UnsupportedOperationException(); |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
185 } |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
186 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
187 @Override |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
188 protected NumberFormat createFormatter(final CallContext context) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
189 throw new UnsupportedOperationException(); |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
190 } |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
191 }; |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
192 public static final UInfoResultType waterlevelMH5 = new UInfoResultType(null, null) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
193 private static final long serialVersionUID = 1L; |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
194 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
195 @Override |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
196 public String exportValue(final CallContext context, final Object value) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
197 throw new UnsupportedOperationException(); |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
198 } |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
199 |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
200 @Override |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
201 protected NumberFormat createFormatter(final CallContext context) { |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
202 throw new UnsupportedOperationException(); |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
203 } |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
204 }; |
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9361
diff
changeset
|
205 } |