Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java @ 8951:322b0e6298ea
Work on SINFO FlowDepth-Development
author | gernotbelger |
---|---|
date | Fri, 16 Mar 2018 18:08:38 +0100 |
parents | b0aeed4c97c1 |
children | 7c1611b5a59e |
comparison
equal
deleted
inserted
replaced
8950:b0aeed4c97c1 | 8951:322b0e6298ea |
---|---|
278 | 278 |
279 @Override | 279 @Override |
280 protected NumberFormat createFormatter(final CallContext context) { | 280 protected NumberFormat createFormatter(final CallContext context) { |
281 return Formatter.getFlowDepth(context); | 281 return Formatter.getFlowDepth(context); |
282 } | 282 } |
283 }, | |
284 flowdepthDevelopment(SInfoI18NStrings.UNIT_CM, SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_HEADER) { | |
285 @Override | |
286 public String exportValue(final CallContext context, final Object value) { | |
287 final double doubleValue = asDouble(value); | |
288 return exportDoubleValue(context, doubleValue); | |
289 } | |
290 | |
291 @Override | |
292 protected NumberFormat createFormatter(final CallContext context) { | |
293 return Formatter.getTkh(context); | |
294 } | |
295 }, | |
296 flowdepthDevelopmentPerYear(SInfoI18NStrings.UNIT_CM_A, SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_PER_YEAR_HEADER) { | |
297 @Override | |
298 public String exportValue(final CallContext context, final Object value) { | |
299 final double doubleValue = asDouble(value); | |
300 return exportDoubleValue(context, doubleValue); | |
301 } | |
302 | |
303 @Override | |
304 protected NumberFormat createFormatter(final CallContext context) { | |
305 return Formatter.getFlowDepthDevelopmentPerYear(context); | |
306 } | |
307 }, | |
308 waterlevelDifference(SInfoI18NStrings.UNIT_CM, SInfoI18NStrings.CSV_WATERLEVEL_DIFFERENCE_HEADER) { | |
309 @Override | |
310 public String exportValue(final CallContext context, final Object value) { | |
311 final double doubleValue = asDouble(value); | |
312 return exportDoubleValue(context, doubleValue); | |
313 } | |
314 | |
315 @Override | |
316 protected NumberFormat createFormatter(final CallContext context) { | |
317 return Formatter.getTkh(context); | |
318 } | |
319 }, | |
320 bedHeightDifference(SInfoI18NStrings.UNIT_CM, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_DIFFERENCE_HEADER) { | |
321 @Override | |
322 public String exportValue(final CallContext context, final Object value) { | |
323 final double doubleValue = asDouble(value); | |
324 return exportDoubleValue(context, doubleValue); | |
325 } | |
326 | |
327 @Override | |
328 protected NumberFormat createFormatter(final CallContext context) { | |
329 return Formatter.getTkh(context); | |
330 } | |
331 }, | |
332 flowdepthCurrent(SInfoI18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_CURRENT_HEADER) { | |
333 @Override | |
334 public String exportValue(final CallContext context, final Object value) { | |
335 final double doubleValue = asDouble(value); | |
336 return exportDoubleValue(context, doubleValue); | |
337 } | |
338 | |
339 @Override | |
340 protected NumberFormat createFormatter(final CallContext context) { | |
341 return Formatter.getFlowDepth(context); | |
342 } | |
343 }, | |
344 flowdepthHistorical(SInfoI18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HISTORICAL_HEADER) { | |
345 @Override | |
346 public String exportValue(final CallContext context, final Object value) { | |
347 final double doubleValue = asDouble(value); | |
348 return exportDoubleValue(context, doubleValue); | |
349 } | |
350 | |
351 @Override | |
352 protected NumberFormat createFormatter(final CallContext context) { | |
353 return Formatter.getFlowDepth(context); | |
354 } | |
283 }; | 355 }; |
284 | 356 |
285 /* Cache for formatters because Formatter will always create new formats (which is very expensive) */ | 357 /* Cache for formatters because Formatter will always create new formats (which is very expensive) */ |
286 private final Map<Locale, NumberFormat> formatters = new HashMap<>(); | 358 private final Map<Locale, NumberFormat> formatters = new HashMap<>(); |
287 | 359 |