Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/utils/Formatter.java @ 3771:04309ca24614
Locales fix
flys-artifacts/trunk@5476 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Sat, 15 Sep 2012 13:42:44 +0000 |
parents | 0336132ec9db |
children | db4e7ff0b987 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/Formatter.java Sat Sep 15 07:07:51 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/Formatter.java Sat Sep 15 13:42:44 2012 +0000 @@ -1,15 +1,13 @@ package de.intevation.flys.utils; -import de.intevation.artifacts.CallContext; -import de.intevation.artifacts.CallMeta; - -import de.intevation.flys.artifacts.resources.Resources; - import java.text.DateFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; +import java.util.Locale; -import java.util.Locale; +import de.intevation.artifacts.CallContext; +import de.intevation.artifacts.CallMeta; +import de.intevation.flys.artifacts.resources.Resources; public final class Formatter { @@ -81,7 +79,7 @@ public static final int FIX_DELTA_W_DELTA_Q_MAX_DIGITS = 2; /** - * Creates a localised NumberFormatter with given range of decimal digits. + * Creates a localized NumberFormatter with given range of decimal digits. * @param m CallMeta to find the locale. * @param min minimum number of decimal ("fraction") digits. * @param max maximum number of decimal ("fraction") digits. @@ -141,16 +139,16 @@ */ public static NumberFormat getWaterlevelKM(CallContext context) { return getFormatter( - context, - WATERLEVEL_KM_MIN_DIGITS, - WATERLEVEL_KM_MAX_DIGITS); + context, + WATERLEVEL_KM_MIN_DIGITS, + WATERLEVEL_KM_MAX_DIGITS); } public static NumberFormat getWaterlevelW(CallMeta meta) { return getFormatter( - meta, - WATERLEVEL_W_MIN_DIGITS, - WATERLEVEL_W_MAX_DIGITS); + meta, + WATERLEVEL_W_MIN_DIGITS, + WATERLEVEL_W_MAX_DIGITS); } /** @@ -160,9 +158,9 @@ */ public static NumberFormat getWaterlevelW(CallContext context) { return getFormatter( - context, - WATERLEVEL_W_MIN_DIGITS, - WATERLEVEL_W_MAX_DIGITS); + context, + WATERLEVEL_W_MIN_DIGITS, + WATERLEVEL_W_MAX_DIGITS); } @@ -173,16 +171,16 @@ */ public static NumberFormat getWaterlevelQ(CallContext context) { return getFormatter( - context, - WATERLEVEL_Q_MIN_DIGITS, - WATERLEVEL_Q_MAX_DIGITS); + context, + WATERLEVEL_Q_MIN_DIGITS, + WATERLEVEL_Q_MAX_DIGITS); } public static NumberFormat getWaterlevelQ(CallMeta meta) { return getFormatter( - meta, - WATERLEVEL_Q_MIN_DIGITS, - WATERLEVEL_Q_MAX_DIGITS); + meta, + WATERLEVEL_Q_MIN_DIGITS, + WATERLEVEL_Q_MAX_DIGITS); } /** @@ -193,9 +191,9 @@ */ public static NumberFormat getComputedDischargeW(CallContext context) { return getFormatter( - context, - COMPUTED_DISCHARGE_W_MIN_DIGITS, - COMPUTED_DISCHARGE_W_MAX_DIGITS); + context, + COMPUTED_DISCHARGE_W_MIN_DIGITS, + COMPUTED_DISCHARGE_W_MAX_DIGITS); } @@ -207,9 +205,9 @@ */ public static NumberFormat getComputedDischargeQ(CallContext context) { return getFormatter( - context, - COMPUTED_DISCHARGE_Q_MIN_DIGITS, - COMPUTED_DISCHARGE_Q_MAX_DIGITS); + context, + COMPUTED_DISCHARGE_Q_MIN_DIGITS, + COMPUTED_DISCHARGE_Q_MAX_DIGITS); } @@ -221,9 +219,9 @@ */ public static NumberFormat getHistoricalDischargeW(CallContext context) { return getFormatter( - context, - HISTORICAL_DISCHARGE_W_MIN_DIGITS, - HISTORICAL_DISCHARGE_W_MAX_DIGITS); + context, + HISTORICAL_DISCHARGE_W_MIN_DIGITS, + HISTORICAL_DISCHARGE_W_MAX_DIGITS); } @@ -235,9 +233,9 @@ */ public static NumberFormat getHistoricalDischargeQ(CallContext context) { return getFormatter( - context, - HISTORICAL_DISCHARGE_Q_MIN_DIGITS, - HISTORICAL_DISCHARGE_Q_MAX_DIGITS); + context, + HISTORICAL_DISCHARGE_Q_MIN_DIGITS, + HISTORICAL_DISCHARGE_Q_MAX_DIGITS); } @@ -248,9 +246,9 @@ */ public static NumberFormat getDurationW(CallContext context) { return getFormatter( - context, - DURATION_W_MIN_DIGITS, - DURATION_W_MAX_DIGITS); + context, + DURATION_W_MIN_DIGITS, + DURATION_W_MAX_DIGITS); } @@ -261,9 +259,9 @@ */ public static NumberFormat getDurationQ(CallContext context) { return getFormatter( - context, - DURATION_Q_MIN_DIGITS, - DURATION_Q_MAX_DIGITS); + context, + DURATION_Q_MIN_DIGITS, + DURATION_Q_MAX_DIGITS); } @@ -274,123 +272,123 @@ */ public static NumberFormat getDurationD(CallContext context) { return getFormatter( - context, - DURATION_D_MIN_DIGITS, - DURATION_D_MAX_DIGITS); + context, + DURATION_D_MIN_DIGITS, + DURATION_D_MAX_DIGITS); } public static NumberFormat getCalculationKm(CallMeta meta) { return getFormatter( - meta, - CALCULATION_REPORT_KM_MIN_DIGITS, - CALCULATION_REPORT_KM_MAX_DIGITS); + meta, + CALCULATION_REPORT_KM_MIN_DIGITS, + CALCULATION_REPORT_KM_MAX_DIGITS); } public static NumberFormat getFlowVelocityKM(CallContext context) { return getFormatter( - context, - FLOW_VELOCITY_KM_MIN_DIGITS, - FLOW_VELOCITY_KM_MAX_DIGITS); + context, + FLOW_VELOCITY_KM_MIN_DIGITS, + FLOW_VELOCITY_KM_MAX_DIGITS); } public static NumberFormat getFlowVelocityValues(CallContext context) { return getFormatter( - context, - FLOW_VELOCITY_VALUES_MIN_DIGITS, - FLOW_VELOCITY_VALUES_MAX_DIGITS); + context, + FLOW_VELOCITY_VALUES_MIN_DIGITS, + FLOW_VELOCITY_VALUES_MAX_DIGITS); } public static NumberFormat getFlowVelocityQ(CallContext context) { return getFormatter( - context, - FLOW_VELOCITY_Q_MIN_DIGITS, - FLOW_VELOCITY_Q_MAX_DIGITS); + context, + FLOW_VELOCITY_Q_MIN_DIGITS, + FLOW_VELOCITY_Q_MAX_DIGITS); } public static NumberFormat getMiddleBedHeightKM(CallContext context) { return getFormatter( - context, - MIDDLE_BED_HEIGHT_KM_MIN_DIGITS, - MIDDLE_BED_HEIGHT_KM_MAX_DIGITS); + context, + MIDDLE_BED_HEIGHT_KM_MIN_DIGITS, + MIDDLE_BED_HEIGHT_KM_MAX_DIGITS); } public static NumberFormat getMiddleBedHeightHeight(CallContext context) { return getFormatter( - context, - MIDDLE_BED_HEIGHT_HEIGHT_MIN_DIGITS, - MIDDLE_BED_HEIGHT_HEIGHT_MAX_DIGITS); + context, + MIDDLE_BED_HEIGHT_HEIGHT_MIN_DIGITS, + MIDDLE_BED_HEIGHT_HEIGHT_MAX_DIGITS); } public static NumberFormat getMiddleBedHeightUncert(CallContext context) { return getFormatter( - context, - MIDDLE_BED_HEIGHT_UNCERT_MIN_DIGITS, - MIDDLE_BED_HEIGHT_UNCERT_MAX_DIGITS); + context, + MIDDLE_BED_HEIGHT_UNCERT_MIN_DIGITS, + MIDDLE_BED_HEIGHT_UNCERT_MAX_DIGITS); } public static NumberFormat getMiddleBedHeightDataGap(CallContext context) { return getFormatter( - context, - MIDDLE_BED_HEIGHT_DATAGAP_MIN_DIGITS, - MIDDLE_BED_HEIGHT_DATAGAP_MAX_DIGITS); + context, + MIDDLE_BED_HEIGHT_DATAGAP_MIN_DIGITS, + MIDDLE_BED_HEIGHT_DATAGAP_MAX_DIGITS); } public static NumberFormat getMiddleBedHeightSounding(CallContext context) { return getFormatter( - context, - MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MIN_DIGITS, - MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MAX_DIGITS); + context, + MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MIN_DIGITS, + MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MAX_DIGITS); } public static NumberFormat getMiddleBedHeightWidth(CallContext context) { return getFormatter( - context, - MIDDLE_BED_HEIGHT_WIDTH_MIN_DIGITS, - MIDDLE_BED_HEIGHT_WIDTH_MAX_DIGITS); + context, + MIDDLE_BED_HEIGHT_WIDTH_MIN_DIGITS, + MIDDLE_BED_HEIGHT_WIDTH_MAX_DIGITS); } public static NumberFormat getFixDeltaWKM(CallContext context) { return getFormatter( - context, - FIX_DELTA_W_KM_MIN_DIGITS, - FIX_DELTA_W_KM_MAX_DIGITS); + context, + FIX_DELTA_W_KM_MIN_DIGITS, + FIX_DELTA_W_KM_MAX_DIGITS); } public static NumberFormat getFixDeltaWDeltaW(CallContext context) { return getFormatter( - context, - FIX_DELTA_W_DELTA_W_MIN_DIGITS, - FIX_DELTA_W_DELTA_W_MAX_DIGITS); + context, + FIX_DELTA_W_DELTA_W_MIN_DIGITS, + FIX_DELTA_W_DELTA_W_MAX_DIGITS); } public static NumberFormat getFixDeltaWQ(CallContext context) { return getFormatter( - context, - FIX_DELTA_W_DELTA_Q_MIN_DIGITS, - FIX_DELTA_W_DELTA_Q_MAX_DIGITS); + context, + FIX_DELTA_W_DELTA_Q_MIN_DIGITS, + FIX_DELTA_W_DELTA_Q_MAX_DIGITS); } public static NumberFormat getFixDeltaWW(CallContext context) { return getFormatter( - context, - FIX_DELTA_W_DELTA_W_MIN_DIGITS, - FIX_DELTA_W_DELTA_W_MAX_DIGITS); + context, + FIX_DELTA_W_DELTA_W_MIN_DIGITS, + FIX_DELTA_W_DELTA_W_MAX_DIGITS); } public static NumberFormat getMeterFormat(CallContext context) { return getFormatter( - context, - 0, - 2); + context, + 0, + 2); }