Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/utils/Formatter.java @ 2714:2952f6dee5cf
Added an exporter for middle bed height values.
flys-artifacts/trunk@4438 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 18 May 2012 10:51:04 +0000 |
parents | 4c00cf83fff1 |
children | e63969c173e9 |
comparison
equal
deleted
inserted
replaced
2713:b60751cfdd6c | 2714:2952f6dee5cf |
---|---|
55 public static final int FLOW_VELOCITY_VALUES_MAX_DIGITS = 2; | 55 public static final int FLOW_VELOCITY_VALUES_MAX_DIGITS = 2; |
56 public static final int FLOW_VELOCITY_Q_MIN_DIGITS = 0; | 56 public static final int FLOW_VELOCITY_Q_MIN_DIGITS = 0; |
57 public static final int FLOW_VELOCITY_Q_MAX_DIGITS = 2; | 57 public static final int FLOW_VELOCITY_Q_MAX_DIGITS = 2; |
58 | 58 |
59 | 59 |
60 // MIDDLE BED HEIGHT FORMATTER CONSTANTS | |
61 public static final int MIDDLE_BED_HEIGHT_KM_MIN_DIGITS = 3; | |
62 public static final int MIDDLE_BED_HEIGHT_KM_MAX_DIGITS = 3; | |
63 public static final int MIDDLE_BED_HEIGHT_HEIGHT_MIN_DIGITS = 3; | |
64 public static final int MIDDLE_BED_HEIGHT_HEIGHT_MAX_DIGITS = 3; | |
65 public static final int MIDDLE_BED_HEIGHT_UNCERT_MIN_DIGITS = 3; | |
66 public static final int MIDDLE_BED_HEIGHT_UNCERT_MAX_DIGITS = 3; | |
67 public static final int MIDDLE_BED_HEIGHT_DATAGAP_MIN_DIGITS = 2; | |
68 public static final int MIDDLE_BED_HEIGHT_DATAGAP_MAX_DIGITS = 2; | |
69 public static final int MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MIN_DIGITS = 0; | |
70 public static final int MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MAX_DIGITS = 0; | |
71 public static final int MIDDLE_BED_HEIGHT_WIDTH_MIN_DIGITS = 3; | |
72 public static final int MIDDLE_BED_HEIGHT_WIDTH_MAX_DIGITS = 3; | |
73 | |
60 public static NumberFormat getFormatter(CallMeta m, int min, int max){ | 74 public static NumberFormat getFormatter(CallMeta m, int min, int max){ |
61 Locale locale = Resources.getLocale(m); | 75 Locale locale = Resources.getLocale(m); |
62 NumberFormat nf = NumberFormat.getInstance(locale); | 76 NumberFormat nf = NumberFormat.getInstance(locale); |
63 | 77 |
64 nf.setMaximumFractionDigits(max); | 78 nf.setMaximumFractionDigits(max); |
264 return getFormatter( | 278 return getFormatter( |
265 context, | 279 context, |
266 FLOW_VELOCITY_Q_MIN_DIGITS, | 280 FLOW_VELOCITY_Q_MIN_DIGITS, |
267 FLOW_VELOCITY_Q_MAX_DIGITS); | 281 FLOW_VELOCITY_Q_MAX_DIGITS); |
268 } | 282 } |
283 | |
284 | |
285 public static NumberFormat getMiddleBedHeightKM(CallContext context) { | |
286 return getFormatter( | |
287 context, | |
288 MIDDLE_BED_HEIGHT_KM_MIN_DIGITS, | |
289 MIDDLE_BED_HEIGHT_KM_MAX_DIGITS); | |
290 } | |
291 | |
292 | |
293 public static NumberFormat getMiddleBedHeightHeight(CallContext context) { | |
294 return getFormatter( | |
295 context, | |
296 MIDDLE_BED_HEIGHT_HEIGHT_MIN_DIGITS, | |
297 MIDDLE_BED_HEIGHT_HEIGHT_MAX_DIGITS); | |
298 } | |
299 | |
300 | |
301 public static NumberFormat getMiddleBedHeightUncert(CallContext context) { | |
302 return getFormatter( | |
303 context, | |
304 MIDDLE_BED_HEIGHT_UNCERT_MIN_DIGITS, | |
305 MIDDLE_BED_HEIGHT_UNCERT_MAX_DIGITS); | |
306 } | |
307 | |
308 | |
309 public static NumberFormat getMiddleBedHeightDataGap(CallContext context) { | |
310 return getFormatter( | |
311 context, | |
312 MIDDLE_BED_HEIGHT_DATAGAP_MIN_DIGITS, | |
313 MIDDLE_BED_HEIGHT_DATAGAP_MAX_DIGITS); | |
314 } | |
315 | |
316 | |
317 public static NumberFormat getMiddleBedHeightSounding(CallContext context) { | |
318 return getFormatter( | |
319 context, | |
320 MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MIN_DIGITS, | |
321 MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MAX_DIGITS); | |
322 } | |
323 | |
324 | |
325 public static NumberFormat getMiddleBedHeightWidth(CallContext context) { | |
326 return getFormatter( | |
327 context, | |
328 MIDDLE_BED_HEIGHT_WIDTH_MIN_DIGITS, | |
329 MIDDLE_BED_HEIGHT_WIDTH_MAX_DIGITS); | |
330 } | |
269 } | 331 } |
270 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 332 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |