Mercurial > dive4elements > river
changeset 9188:3931e8741f53
Minor cleanup and bugfix concerning number formatters
author | gernotbelger |
---|---|
date | Thu, 28 Jun 2018 13:14:44 +0200 |
parents | b3c11c5fdbd5 |
children | 13a0c4be17ea ed4b14389667 |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/common/ExportContextCSV.java |
diffstat | 1 files changed, 9 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/common/ExportContextCSV.java Thu Jun 28 10:47:08 2018 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/common/ExportContextCSV.java Thu Jun 28 13:14:44 2018 +0200 @@ -50,11 +50,11 @@ private static final String CSV_META_HEADER_SOUNDING_ELEVATIOIN_MODEL_ORIGINAL = "sinfo.export.flow_depth.csv.meta.header.sounding.elevationmodel.original"; - private static NumberFormat qFormat = null; + private NumberFormat qFormat = null; - private static NumberFormat flowDepthFormat = null; + private NumberFormat flowDepthFormat = null; - private NumberFormat kmFormat; + private NumberFormat kmFormat = null; /** The CallContext object. */ private final CallContext context; @@ -83,7 +83,6 @@ public void writeBlankLine() { writeCSVLine(new String[] { "" }); - } // *** CUSTOM STUFF that is used multiple times ***/// @@ -110,7 +109,7 @@ source.addMetaData(key, type.getPdfHeader(this.context.getMeta())); } - public final void writeCSVGlobalMetadataDefaults(final AbstractCalculationResults results) { + public final void writeCSVGlobalMetadataDefaults(final AbstractCalculationResults<?> results) { // TODO: results as member final String calcModeLabel = results.getCalcModeLabel(); final RiverInfo river = results.getRiver(); @@ -165,27 +164,27 @@ // copy from AbstractExporter TODO merge with ExportContextPDF protected NumberFormat getKmFormatter() { - if (this.kmFormat == null) { + if (this.kmFormat == null) this.kmFormat = Formatter.getWaterlevelKM(this.context); - } + return this.kmFormat; } public void addJRMetadata(final MetaAndTableJRDataSource source, final String key, final String msg) { source.addMetaData(key, msg); - } public NumberFormat getQFormatter() { - if (this.qFormat == null) { + if (this.qFormat == null) this.qFormat = Formatter.getWaterlevelQ(this.context); - } + return this.qFormat; } public final NumberFormat getFlowDepthFormatter() { if (this.flowDepthFormat == null) this.flowDepthFormat = Formatter.getFlowDepth(this.context); + return this.flowDepthFormat; } @@ -231,7 +230,6 @@ public String msgPdf(final SInfoResultType type) { return type.getPdfHeader(this.context.getMeta()); - } public void writeTitleForTabs(final String tabTitleMsg, final int colSize) {