comparison flys-artifacts/src/main/java/de/intevation/flys/utils/Formatter.java @ 3402:0336132ec9db

Adjusted Delta W(t) CSV exporter to customers wishes. flys-artifacts/trunk@5044 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 18 Jul 2012 16:28:00 +0000
parents 6d1740533810
children 04309ca24614
comparison
equal deleted inserted replaced
3401:086326be721c 3402:0336132ec9db
1 package de.intevation.flys.utils; 1 package de.intevation.flys.utils;
2
3 import de.intevation.artifacts.CallContext;
4 import de.intevation.artifacts.CallMeta;
5
6 import de.intevation.flys.artifacts.resources.Resources;
2 7
3 import java.text.DateFormat; 8 import java.text.DateFormat;
4 import java.text.NumberFormat; 9 import java.text.NumberFormat;
10 import java.text.SimpleDateFormat;
11
5 import java.util.Locale; 12 import java.util.Locale;
6
7 import de.intevation.artifacts.CallContext;
8 import de.intevation.artifacts.CallMeta;
9
10 import de.intevation.flys.artifacts.resources.Resources;
11 13
12 14
13 public final class Formatter { 15 public final class Formatter {
14 16
15 // KMS IN ERROR REPORTS. 17 // KMS IN ERROR REPORTS.
375 context, 377 context,
376 FIX_DELTA_W_DELTA_Q_MIN_DIGITS, 378 FIX_DELTA_W_DELTA_Q_MIN_DIGITS,
377 FIX_DELTA_W_DELTA_Q_MAX_DIGITS); 379 FIX_DELTA_W_DELTA_Q_MAX_DIGITS);
378 } 380 }
379 381
382 public static NumberFormat getFixDeltaWW(CallContext context) {
383 return getFormatter(
384 context,
385 FIX_DELTA_W_DELTA_W_MIN_DIGITS,
386 FIX_DELTA_W_DELTA_W_MAX_DIGITS);
387 }
380 388
381 public static NumberFormat getMeterFormat(CallContext context) { 389 public static NumberFormat getMeterFormat(CallContext context) {
382 return getFormatter( 390 return getFormatter(
383 context, 391 context,
384 0, 392 0,
385 2); 393 2);
386 394
387 } 395 }
396
397 public static DateFormat getDateFormatter(CallMeta m, String pattern) {
398 Locale locale = Resources.getLocale(m);
399 return new SimpleDateFormat(pattern, locale);
400 }
388 } 401 }
389 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 402 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org