Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/utils/Formatter.java @ 5744:5bb179d4fd5f
SedimentLoadFacet: Avoid weird steps, find correct measurement stations.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 17 Apr 2013 14:53:16 +0200 |
parents | db4e7ff0b987 |
children |
rev | line source |
---|---|
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.utils; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
3402
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
3 import java.text.DateFormat; |
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
4 import java.text.NumberFormat; |
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
5 import java.text.SimpleDateFormat; |
3771 | 6 import java.util.Locale; |
3402
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
7 |
3771 | 8 import de.intevation.artifacts.CallContext; |
9 import de.intevation.artifacts.CallMeta; | |
10 import de.intevation.flys.artifacts.resources.Resources; | |
3402
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
11 |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
5639
db4e7ff0b987
Doc and whitespaces.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3771
diff
changeset
|
13 /** Helper to access static i18n Formatters. */ |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 public final class Formatter { |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
2290
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
16 // KMS IN ERROR REPORTS. |
2305
ff558d0332e2
Error report: Format kms in error reports at least with one digit after the decimal separator.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2290
diff
changeset
|
17 public static final int CALCULATION_REPORT_KM_MIN_DIGITS = 1; |
2290
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
18 public static final int CALCULATION_REPORT_KM_MAX_DIGITS = 3; |
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
19 |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 // WATERLEVEL FORMATTER CONSTANTS |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 public static final int WATERLEVEL_KM_MIN_DIGITS = 3; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 public static final int WATERLEVEL_KM_MAX_DIGITS = 3; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 public static final int WATERLEVEL_W_MIN_DIGITS = 0; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 public static final int WATERLEVEL_W_MAX_DIGITS = 2; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 public static final int WATERLEVEL_Q_MIN_DIGITS = 0; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 public static final int WATERLEVEL_Q_MAX_DIGITS = 2; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 // COMPUTED DISCHARGE CURVE FORMATTER CONSTANTS |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 public static final int COMPUTED_DISCHARGE_W_MIN_DIGITS = 2; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 public static final int COMPUTED_DISCHARGE_W_MAX_DIGITS = 2; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 public static final int COMPUTED_DISCHARGE_Q_MIN_DIGITS = 0; |
1683
acb4d20b130e
Changed max number of digits for AT exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
445
diff
changeset
|
33 public static final int COMPUTED_DISCHARGE_Q_MAX_DIGITS = 2; |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
36 // HISTORICAL DISCHARGE CURVE FORMATTER CONSTANTS |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
37 public static final int HISTORICAL_DISCHARGE_W_MIN_DIGITS = 0; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
38 public static final int HISTORICAL_DISCHARGE_W_MAX_DIGITS = 2; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
39 public static final int HISTORICAL_DISCHARGE_Q_MIN_DIGITS = 0; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
40 public static final int HISTORICAL_DISCHARGE_Q_MAX_DIGITS = 2; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
41 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
42 |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 // DURATION CURVE FORMATTER CONSTANTS |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 public static final int DURATION_W_MIN_DIGITS = 0; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 public static final int DURATION_W_MAX_DIGITS = 2; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 public static final int DURATION_Q_MIN_DIGITS = 0; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 public static final int DURATION_Q_MAX_DIGITS = 1; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 public static final int DURATION_D_MIN_DIGITS = 0; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 public static final int DURATION_D_MAX_DIGITS = 0; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
52 // FLOW VELOCITY FORMATTER CONSTANTS |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
53 public static final int FLOW_VELOCITY_KM_MIN_DIGITS = 3; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
54 public static final int FLOW_VELOCITY_KM_MAX_DIGITS = 3; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
55 public static final int FLOW_VELOCITY_VALUES_MIN_DIGITS = 2; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
56 public static final int FLOW_VELOCITY_VALUES_MAX_DIGITS = 2; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
57 public static final int FLOW_VELOCITY_Q_MIN_DIGITS = 0; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
58 public static final int FLOW_VELOCITY_Q_MAX_DIGITS = 2; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
59 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
60 |
2714
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
61 // MIDDLE BED HEIGHT FORMATTER CONSTANTS |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
62 public static final int MIDDLE_BED_HEIGHT_KM_MIN_DIGITS = 3; |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
63 public static final int MIDDLE_BED_HEIGHT_KM_MAX_DIGITS = 3; |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
64 public static final int MIDDLE_BED_HEIGHT_HEIGHT_MIN_DIGITS = 3; |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
65 public static final int MIDDLE_BED_HEIGHT_HEIGHT_MAX_DIGITS = 3; |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
66 public static final int MIDDLE_BED_HEIGHT_UNCERT_MIN_DIGITS = 3; |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
67 public static final int MIDDLE_BED_HEIGHT_UNCERT_MAX_DIGITS = 3; |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
68 public static final int MIDDLE_BED_HEIGHT_DATAGAP_MIN_DIGITS = 2; |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
69 public static final int MIDDLE_BED_HEIGHT_DATAGAP_MAX_DIGITS = 2; |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
70 public static final int MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MIN_DIGITS = 0; |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
71 public static final int MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MAX_DIGITS = 0; |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
72 public static final int MIDDLE_BED_HEIGHT_WIDTH_MIN_DIGITS = 3; |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
73 public static final int MIDDLE_BED_HEIGHT_WIDTH_MAX_DIGITS = 3; |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
74 |
2787
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
75 public static final int FIX_DELTA_W_KM_MIN_DIGITS = 3; |
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
76 public static final int FIX_DELTA_W_KM_MAX_DIGITS = 3; |
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
77 public static final int FIX_DELTA_W_DELTA_W_MIN_DIGITS = 3; |
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
78 public static final int FIX_DELTA_W_DELTA_W_MAX_DIGITS = 3; |
3397
6d1740533810
FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3162
diff
changeset
|
79 public static final int FIX_DELTA_W_DELTA_Q_MIN_DIGITS = 0; |
6d1740533810
FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3162
diff
changeset
|
80 public static final int FIX_DELTA_W_DELTA_Q_MAX_DIGITS = 2; |
2787
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
81 |
5639
db4e7ff0b987
Doc and whitespaces.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3771
diff
changeset
|
82 |
3017
296b067e17e6
i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2787
diff
changeset
|
83 /** |
3771 | 84 * Creates a localized NumberFormatter with given range of decimal digits. |
3017
296b067e17e6
i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2787
diff
changeset
|
85 * @param m CallMeta to find the locale. |
296b067e17e6
i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2787
diff
changeset
|
86 * @param min minimum number of decimal ("fraction") digits. |
296b067e17e6
i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2787
diff
changeset
|
87 * @param max maximum number of decimal ("fraction") digits. |
296b067e17e6
i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2787
diff
changeset
|
88 * @return A NumberFormat. Use #format(NUMBER) to get String representation |
296b067e17e6
i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2787
diff
changeset
|
89 * of NUMBER. |
296b067e17e6
i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2787
diff
changeset
|
90 */ |
2290
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
91 public static NumberFormat getFormatter(CallMeta m, int min, int max){ |
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
92 Locale locale = Resources.getLocale(m); |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 NumberFormat nf = NumberFormat.getInstance(locale); |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 nf.setMaximumFractionDigits(max); |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 nf.setMinimumFractionDigits(min); |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 return nf; |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 } |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 |
5639
db4e7ff0b987
Doc and whitespaces.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3771
diff
changeset
|
101 |
2290
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
102 public static NumberFormat getFormatter(CallContext c, int min, int max){ |
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
103 return getFormatter(c.getMeta(), min, max); |
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
104 } |
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
105 |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 /** |
2087
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
108 * Returns a number formatter with no max or min digits set. |
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
109 * |
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
110 * @param c The CallContext. |
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
111 * |
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
112 * @return a number formatter. |
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
113 */ |
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
114 public static NumberFormat getRawFormatter(CallContext c) { |
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
115 Locale locale = Resources.getLocale(c.getMeta()); |
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
116 return NumberFormat.getInstance(locale); |
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
117 } |
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
118 |
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
119 |
bda04ae1154f
#196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1683
diff
changeset
|
120 /** |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
121 * Returns a date formatter with SHORT style. |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
122 */ |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
123 public static DateFormat getShortDateFormat(CallContext cc) { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
124 Locale locale = Resources.getLocale(cc.getMeta()); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
125 return DateFormat.getDateInstance(DateFormat.SHORT, locale); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
126 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
127 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
128 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
129 /** |
2588
7dd45896e941
Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2305
diff
changeset
|
130 * Returns a date formatter with MEDIUM style. |
7dd45896e941
Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2305
diff
changeset
|
131 */ |
7dd45896e941
Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2305
diff
changeset
|
132 public static DateFormat getMediumDateFormat(CallContext cc) { |
7dd45896e941
Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2305
diff
changeset
|
133 Locale locale = Resources.getLocale(cc.getMeta()); |
7dd45896e941
Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2305
diff
changeset
|
134 return DateFormat.getDateInstance(DateFormat.MEDIUM, locale); |
7dd45896e941
Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2305
diff
changeset
|
135 } |
7dd45896e941
Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2305
diff
changeset
|
136 |
7dd45896e941
Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2305
diff
changeset
|
137 |
7dd45896e941
Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2305
diff
changeset
|
138 /** |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 * Returns the number formatter for kilometer values in waterlevel exports. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 * |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 * @return the number formatter for kilometer values. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 */ |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 public static NumberFormat getWaterlevelKM(CallContext context) { |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 return getFormatter( |
3771 | 145 context, |
146 WATERLEVEL_KM_MIN_DIGITS, | |
147 WATERLEVEL_KM_MAX_DIGITS); | |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 } |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 |
5639
db4e7ff0b987
Doc and whitespaces.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3771
diff
changeset
|
150 |
3162
0d8146989012
Added labeling for Q/W points FixingsKMChartService.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
151 public static NumberFormat getWaterlevelW(CallMeta meta) { |
0d8146989012
Added labeling for Q/W points FixingsKMChartService.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
152 return getFormatter( |
3771 | 153 meta, |
154 WATERLEVEL_W_MIN_DIGITS, | |
155 WATERLEVEL_W_MAX_DIGITS); | |
3162
0d8146989012
Added labeling for Q/W points FixingsKMChartService.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
156 } |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 |
5639
db4e7ff0b987
Doc and whitespaces.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3771
diff
changeset
|
158 |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 /** |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 * Returns the number formatter for W values in waterlevel exports. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 * |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 * @return the number formatter for W values. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 */ |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
164 public static NumberFormat getWaterlevelW(CallContext context) { |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 return getFormatter( |
3771 | 166 context, |
167 WATERLEVEL_W_MIN_DIGITS, | |
168 WATERLEVEL_W_MAX_DIGITS); | |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 } |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
172 /** |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
173 * Returns the number formatter for Q values in waterlevel exports. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
174 * |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
175 * @return the number formatter for Q values. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
176 */ |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
177 public static NumberFormat getWaterlevelQ(CallContext context) { |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
178 return getFormatter( |
3771 | 179 context, |
180 WATERLEVEL_Q_MIN_DIGITS, | |
181 WATERLEVEL_Q_MAX_DIGITS); | |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
182 } |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 |
5639
db4e7ff0b987
Doc and whitespaces.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3771
diff
changeset
|
184 |
3162
0d8146989012
Added labeling for Q/W points FixingsKMChartService.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
185 public static NumberFormat getWaterlevelQ(CallMeta meta) { |
0d8146989012
Added labeling for Q/W points FixingsKMChartService.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
186 return getFormatter( |
3771 | 187 meta, |
188 WATERLEVEL_Q_MIN_DIGITS, | |
189 WATERLEVEL_Q_MAX_DIGITS); | |
3162
0d8146989012
Added labeling for Q/W points FixingsKMChartService.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
190 } |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
191 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
192 /** |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 * Returns the number formatter for W values in exports of computed |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
194 * discharge curves. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
195 * |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
196 * @return the number formatter for W values. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 */ |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 public static NumberFormat getComputedDischargeW(CallContext context) { |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 return getFormatter( |
3771 | 200 context, |
201 COMPUTED_DISCHARGE_W_MIN_DIGITS, | |
202 COMPUTED_DISCHARGE_W_MAX_DIGITS); | |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 } |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
204 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
205 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 /** |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 * Returns the number formatter for Q values in exports of computed |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 * discharge curves. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 * |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 * @return the number formatter for Q values. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
211 */ |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 public static NumberFormat getComputedDischargeQ(CallContext context) { |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 return getFormatter( |
3771 | 214 context, |
215 COMPUTED_DISCHARGE_Q_MIN_DIGITS, | |
216 COMPUTED_DISCHARGE_Q_MAX_DIGITS); | |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
217 } |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 /** |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
221 * Returns the number formatter for W values in exports of historical |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
222 * discharge curves. |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
223 * |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
224 * @return the number formatter for W values. |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
225 */ |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
226 public static NumberFormat getHistoricalDischargeW(CallContext context) { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
227 return getFormatter( |
3771 | 228 context, |
229 HISTORICAL_DISCHARGE_W_MIN_DIGITS, | |
230 HISTORICAL_DISCHARGE_W_MAX_DIGITS); | |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
231 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
232 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
233 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
234 /** |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
235 * Returns the number formatter for Q values in exports of historical |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
236 * discharge curves. |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
237 * |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
238 * @return the number formatter for Q values. |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
239 */ |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
240 public static NumberFormat getHistoricalDischargeQ(CallContext context) { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
241 return getFormatter( |
3771 | 242 context, |
243 HISTORICAL_DISCHARGE_Q_MIN_DIGITS, | |
244 HISTORICAL_DISCHARGE_Q_MAX_DIGITS); | |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
245 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
246 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
247 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2087
diff
changeset
|
248 /** |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
249 * Returns the number formatter for W values in duration curve exports. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
250 * |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
251 * @return the number formatter for W values. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
252 */ |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
253 public static NumberFormat getDurationW(CallContext context) { |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
254 return getFormatter( |
3771 | 255 context, |
256 DURATION_W_MIN_DIGITS, | |
257 DURATION_W_MAX_DIGITS); | |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
258 } |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
259 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
260 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
261 /** |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
262 * Returns the number formatter for Q values in duration curve exports. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
263 * |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
264 * @return the number formatter for W values. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
265 */ |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
266 public static NumberFormat getDurationQ(CallContext context) { |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
267 return getFormatter( |
3771 | 268 context, |
269 DURATION_Q_MIN_DIGITS, | |
270 DURATION_Q_MAX_DIGITS); | |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
271 } |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
272 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
273 |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
274 /** |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
275 * Returns the number formatter for D values in duration curve exports. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
276 * |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
277 * @return the number formatter for W values. |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
278 */ |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
279 public static NumberFormat getDurationD(CallContext context) { |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
280 return getFormatter( |
3771 | 281 context, |
282 DURATION_D_MIN_DIGITS, | |
283 DURATION_D_MAX_DIGITS); | |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
284 } |
2290
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
285 |
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
286 public static NumberFormat getCalculationKm(CallMeta meta) { |
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
287 return getFormatter( |
3771 | 288 meta, |
289 CALCULATION_REPORT_KM_MIN_DIGITS, | |
290 CALCULATION_REPORT_KM_MAX_DIGITS); | |
2290
6f4a1f513e89
Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2258
diff
changeset
|
291 } |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
292 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
293 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
294 public static NumberFormat getFlowVelocityKM(CallContext context) { |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
295 return getFormatter( |
3771 | 296 context, |
297 FLOW_VELOCITY_KM_MIN_DIGITS, | |
298 FLOW_VELOCITY_KM_MAX_DIGITS); | |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
299 } |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
300 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
301 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
302 public static NumberFormat getFlowVelocityValues(CallContext context) { |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
303 return getFormatter( |
3771 | 304 context, |
305 FLOW_VELOCITY_VALUES_MIN_DIGITS, | |
306 FLOW_VELOCITY_VALUES_MAX_DIGITS); | |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
307 } |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
308 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
309 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
310 public static NumberFormat getFlowVelocityQ(CallContext context) { |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
311 return getFormatter( |
3771 | 312 context, |
313 FLOW_VELOCITY_Q_MIN_DIGITS, | |
314 FLOW_VELOCITY_Q_MAX_DIGITS); | |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
315 } |
2714
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
316 |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
317 |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
318 public static NumberFormat getMiddleBedHeightKM(CallContext context) { |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
319 return getFormatter( |
3771 | 320 context, |
321 MIDDLE_BED_HEIGHT_KM_MIN_DIGITS, | |
322 MIDDLE_BED_HEIGHT_KM_MAX_DIGITS); | |
2714
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
323 } |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
324 |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
325 |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
326 public static NumberFormat getMiddleBedHeightHeight(CallContext context) { |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
327 return getFormatter( |
3771 | 328 context, |
329 MIDDLE_BED_HEIGHT_HEIGHT_MIN_DIGITS, | |
330 MIDDLE_BED_HEIGHT_HEIGHT_MAX_DIGITS); | |
2714
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
331 } |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
332 |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
333 |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
334 public static NumberFormat getMiddleBedHeightUncert(CallContext context) { |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
335 return getFormatter( |
3771 | 336 context, |
337 MIDDLE_BED_HEIGHT_UNCERT_MIN_DIGITS, | |
338 MIDDLE_BED_HEIGHT_UNCERT_MAX_DIGITS); | |
2714
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
339 } |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
340 |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
341 |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
342 public static NumberFormat getMiddleBedHeightDataGap(CallContext context) { |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
343 return getFormatter( |
3771 | 344 context, |
345 MIDDLE_BED_HEIGHT_DATAGAP_MIN_DIGITS, | |
346 MIDDLE_BED_HEIGHT_DATAGAP_MAX_DIGITS); | |
2714
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
347 } |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
348 |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
349 |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
350 public static NumberFormat getMiddleBedHeightSounding(CallContext context) { |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
351 return getFormatter( |
3771 | 352 context, |
353 MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MIN_DIGITS, | |
354 MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MAX_DIGITS); | |
2714
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
355 } |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
356 |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
357 |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
358 public static NumberFormat getMiddleBedHeightWidth(CallContext context) { |
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
359 return getFormatter( |
3771 | 360 context, |
361 MIDDLE_BED_HEIGHT_WIDTH_MIN_DIGITS, | |
362 MIDDLE_BED_HEIGHT_WIDTH_MAX_DIGITS); | |
2714
2952f6dee5cf
Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
363 } |
2787
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
364 |
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
365 public static NumberFormat getFixDeltaWKM(CallContext context) { |
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
366 return getFormatter( |
3771 | 367 context, |
368 FIX_DELTA_W_KM_MIN_DIGITS, | |
369 FIX_DELTA_W_KM_MAX_DIGITS); | |
2787
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
370 } |
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
371 |
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
372 public static NumberFormat getFixDeltaWDeltaW(CallContext context) { |
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
373 return getFormatter( |
3771 | 374 context, |
375 FIX_DELTA_W_DELTA_W_MIN_DIGITS, | |
376 FIX_DELTA_W_DELTA_W_MAX_DIGITS); | |
2787
e63969c173e9
FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2714
diff
changeset
|
377 } |
3017
296b067e17e6
i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2787
diff
changeset
|
378 |
3397
6d1740533810
FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3162
diff
changeset
|
379 public static NumberFormat getFixDeltaWQ(CallContext context) { |
6d1740533810
FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3162
diff
changeset
|
380 return getFormatter( |
3771 | 381 context, |
382 FIX_DELTA_W_DELTA_Q_MIN_DIGITS, | |
383 FIX_DELTA_W_DELTA_Q_MAX_DIGITS); | |
3397
6d1740533810
FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3162
diff
changeset
|
384 } |
6d1740533810
FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3162
diff
changeset
|
385 |
3402
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
386 public static NumberFormat getFixDeltaWW(CallContext context) { |
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
387 return getFormatter( |
3771 | 388 context, |
389 FIX_DELTA_W_DELTA_W_MIN_DIGITS, | |
390 FIX_DELTA_W_DELTA_W_MAX_DIGITS); | |
3402
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
391 } |
3397
6d1740533810
FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3162
diff
changeset
|
392 |
3017
296b067e17e6
i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2787
diff
changeset
|
393 public static NumberFormat getMeterFormat(CallContext context) { |
296b067e17e6
i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2787
diff
changeset
|
394 return getFormatter( |
3771 | 395 context, |
396 0, | |
397 2); | |
3076
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3017
diff
changeset
|
398 |
3017
296b067e17e6
i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2787
diff
changeset
|
399 } |
3402
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
400 |
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
401 public static DateFormat getDateFormatter(CallMeta m, String pattern) { |
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
402 Locale locale = Resources.getLocale(m); |
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
403 return new SimpleDateFormat(pattern, locale); |
0336132ec9db
Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3397
diff
changeset
|
404 } |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
405 } |
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
406 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |