Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveExporter.java @ 445:a7947972fdeb
Added a new class that supports formatters for different types of data.
flys-artifacts/trunk@1937 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 17 May 2011 14:22:27 +0000 |
parents | e0fec407a280 |
children | e006da5679d2 |
comparison
equal
deleted
inserted
replaced
444:932a5e3c7fa1 | 445:a7947972fdeb |
---|---|
14 import de.intevation.artifacts.Artifact; | 14 import de.intevation.artifacts.Artifact; |
15 import de.intevation.artifacts.CallContext; | 15 import de.intevation.artifacts.CallContext; |
16 | 16 |
17 import de.intevation.flys.artifacts.WINFOArtifact; | 17 import de.intevation.flys.artifacts.WINFOArtifact; |
18 import de.intevation.flys.artifacts.model.WQKms; | 18 import de.intevation.flys.artifacts.model.WQKms; |
19 import de.intevation.flys.utils.Formatter; | |
19 | 20 |
20 | 21 |
21 /** | 22 /** |
22 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 23 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
23 */ | 24 */ |
25 | 26 |
26 /** The logger used in this exporter.*/ | 27 /** The logger used in this exporter.*/ |
27 private static Logger logger = | 28 private static Logger logger = |
28 Logger.getLogger(ComputedDischargeCurveExporter.class); | 29 Logger.getLogger(ComputedDischargeCurveExporter.class); |
29 | 30 |
30 | |
31 public static final int W_MIN_DIGITS = 2; | |
32 public static final int W_MAX_DIGITS = 2; | |
33 public static final int Q_MIN_DIGITS = 0; | |
34 public static final int Q_MAX_DIGITS = 0; | |
35 | 31 |
36 public static final String CSV_W_HEADER = | 32 public static final String CSV_W_HEADER = |
37 "export.computed.discharge.curve.csv.header.w"; | 33 "export.computed.discharge.curve.csv.header.w"; |
38 | 34 |
39 public static final String CSV_Q_HEADER = | 35 public static final String CSV_Q_HEADER = |
100 * Returns the number formatter for W values. | 96 * Returns the number formatter for W values. |
101 * | 97 * |
102 * @return the number formatter for W values. | 98 * @return the number formatter for W values. |
103 */ | 99 */ |
104 protected NumberFormat getWFormatter() { | 100 protected NumberFormat getWFormatter() { |
105 return getFormatter(W_MIN_DIGITS, W_MAX_DIGITS); | 101 return Formatter.getComputedDischargeW(context); |
106 } | 102 } |
107 | 103 |
108 | 104 |
109 /** | 105 /** |
110 * Returns the number formatter for Q values. | 106 * Returns the number formatter for Q values. |
111 * | 107 * |
112 * @return the number formatter for Q values. | 108 * @return the number formatter for Q values. |
113 */ | 109 */ |
114 protected NumberFormat getQFormatter() { | 110 protected NumberFormat getQFormatter() { |
115 return getFormatter(Q_MIN_DIGITS, Q_MAX_DIGITS); | 111 return Formatter.getComputedDischargeQ(context); |
116 } | 112 } |
117 } | 113 } |
118 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 114 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |