comparison artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/BunduResultType.java @ 9444:ecadc9ed0ba0

Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
author mschaefer
date Tue, 21 Aug 2018 13:41:18 +0200
parents d194c5b24bf8
children e60584f2a531
comparison
equal deleted inserted replaced
9443:515643b2c49a 9444:ecadc9ed0ba0
237 protected NumberFormat createFormatter(final CallContext context) { 237 protected NumberFormat createFormatter(final CallContext context) {
238 return Formatter.getIntegerFormatter(context); 238 return Formatter.getIntegerFormatter(context);
239 } 239 }
240 }; 240 };
241 241
242 // RESULT TYPE FIELDS 242 /**
243 * List of bed height values of the 10 fields of a cross section
244 */
245 public static final BunduResultType bedHeightFields = new BunduResultType(null, null) {
246
247 private static final long serialVersionUID = 1L;
248
249 @Override
250 public String exportValue(final CallContext context, final Object value) {
251 final double doubleValue = asDouble(value);
252 return exportDoubleValue(context, doubleValue);
253 }
254
255 @Override
256 protected NumberFormat createFormatter(final CallContext context) {
257 throw new UnsupportedOperationException();
258 }
259 };
260
261 /**
262 * List of depth values of the 10 fields of a cross section
263 */
264 public static final BunduResultType depthFields = new BunduResultType(I18NStrings.UNIT_NONE, null) {
265
266 private static final long serialVersionUID = 1L;
267
268 @Override
269 public String exportValue(final CallContext context, final Object value) {
270 final double doubleValue = asDouble(value);
271 return exportDoubleValue(context, doubleValue);
272 }
273
274 @Override
275 protected NumberFormat createFormatter(final CallContext context) {
276 throw new UnsupportedOperationException();
277 }
278 };
279
280 /**
281 * List of volume values of the 10 fields of a cross section
282 */
243 public static final BunduResultType missVolumeFields = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.volume.field") { 283 public static final BunduResultType missVolumeFields = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.volume.field") {
244 284
245 private static final long serialVersionUID = 1L; 285 private static final long serialVersionUID = 1L;
246 286
247 @Override 287 @Override
254 protected NumberFormat createFormatter(final CallContext context) { 294 protected NumberFormat createFormatter(final CallContext context) {
255 return Formatter.getMassFormat(context); 295 return Formatter.getMassFormat(context);
256 } 296 }
257 }; 297 };
258 298
259 public static final BunduResultType missMassfields = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.mass.field") { 299 /**
300 * List of mass values of the 10 fields of a cross section
301 */
302 public static final BunduResultType missMassFields = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.mass.field") {
260 303
261 private static final long serialVersionUID = 1L; 304 private static final long serialVersionUID = 1L;
262 305
263 @Override 306 @Override
264 public String exportValue(final CallContext context, final Object value) { 307 public String exportValue(final CallContext context, final Object value) {
270 protected NumberFormat createFormatter(final CallContext context) { 313 protected NumberFormat createFormatter(final CallContext context) {
271 return Formatter.getMassFormat(context); 314 return Formatter.getMassFormat(context);
272 } 315 }
273 }; 316 };
274 317
275 public static final BunduResultType missStationRange = new BunduResultType(I18NStrings.UNIT_KM, I18NStrings.CSV_KM_HEADER) { 318 public static final BunduResultType missStationRangeFrom = new BunduResultType(I18NStrings.UNIT_KM, "bundu.export.bezugswst.csv.meta.miss.mass.km_from") {
276 @Override 319
277 public String exportValue(final CallContext context, final Object value) { 320 private static final long serialVersionUID = 1L;
278 return exportStringValue(value); 321
279 } 322 @Override
280 323 public String exportValue(final CallContext context, final Object value) {
281 @Override 324 final double doubleValue = asDouble(value);
282 protected NumberFormat createFormatter(final CallContext context) { 325 return exportDoubleValue(context, doubleValue);
283 throw new UnsupportedOperationException(); 326 }
284 } 327
285 }; 328 @Override
286 329 protected NumberFormat createFormatter(final CallContext context) {
330 return Formatter.getWaterlevelKM(context);
331 }
332 };
333
334 public static final BunduResultType missStationRangeTo = new BunduResultType(I18NStrings.UNIT_KM, "bundu.export.bezugswst.csv.meta.miss.mass.km_to") {
335
336 private static final long serialVersionUID = 1L;
337
338 @Override
339 public String exportValue(final CallContext context, final Object value) {
340 final double doubleValue = asDouble(value);
341 return exportDoubleValue(context, doubleValue);
342 }
343
344 @Override
345 protected NumberFormat createFormatter(final CallContext context) {
346 return Formatter.getWaterlevelKM(context);
347 }
348 };
287 } 349 }

http://dive4elements.wald.intevation.org