annotate flys-artifacts/src/main/java/de/intevation/flys/utils/Formatter.java @ 447:5606ba4139e0

WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation. flys-artifacts/trunk@1939 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 18 May 2011 08:04:54 +0000
parents a7947972fdeb
children acb4d20b130e
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
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import java.text.NumberFormat;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 import java.util.Locale;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 import de.intevation.artifacts.CallContext;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import de.intevation.flys.artifacts.resources.Resources;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 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
12
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 // 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
14 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
15 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
16 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
17 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
18 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
19 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
20
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 // 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
23 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
24 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
25 public static final int COMPUTED_DISCHARGE_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 COMPUTED_DISCHARGE_Q_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
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 // 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
30 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
31 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
32 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
33 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
34 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
35 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
36
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 public static NumberFormat getFormatter(CallContext c, int min, int max){
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 Locale locale = Resources.getLocale(c.getMeta());
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 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
41
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 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
43 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
44
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 return nf;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 * 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
51 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 * @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
53 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 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
55 return getFormatter(
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 context,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 WATERLEVEL_KM_MIN_DIGITS,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 WATERLEVEL_KM_MAX_DIGITS);
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 * 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
64 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 * @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
66 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 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
68 return getFormatter(
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 context,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 WATERLEVEL_W_MIN_DIGITS,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 WATERLEVEL_W_MAX_DIGITS);
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 * 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
77 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 * @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
79 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 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
81 return getFormatter(
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 context,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 WATERLEVEL_Q_MIN_DIGITS,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 WATERLEVEL_Q_MAX_DIGITS);
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 * 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
90 * discharge curves.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 * @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
93 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94 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
95 return getFormatter(
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96 context,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 COMPUTED_DISCHARGE_W_MIN_DIGITS,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98 COMPUTED_DISCHARGE_W_MAX_DIGITS);
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
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
101
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
103 * 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
104 * discharge curves.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 * @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
107 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108 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
109 return getFormatter(
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 context,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 COMPUTED_DISCHARGE_Q_MIN_DIGITS,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112 COMPUTED_DISCHARGE_Q_MAX_DIGITS);
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117 * 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
118 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119 * @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
120 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 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
122 return getFormatter(
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123 context,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124 DURATION_W_MIN_DIGITS,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125 DURATION_W_MAX_DIGITS);
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 * 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
131 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
132 * @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
133 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
134 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
135 return getFormatter(
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
136 context,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
137 DURATION_Q_MIN_DIGITS,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
138 DURATION_Q_MAX_DIGITS);
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
139 }
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
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 * 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
144 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
145 * @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
146 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
147 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
148 return getFormatter(
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
149 context,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
150 DURATION_D_MIN_DIGITS,
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151 DURATION_D_MAX_DIGITS);
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
152 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
153 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
154 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org