Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculationResult.java @ 9285:9b16f58c62a7
Small cleanup/renames
author | mschaefer |
---|---|
date | Mon, 23 Jul 2018 19:18:11 +0200 |
parents | e5367900dd6d |
children | 7a8b9331a946 |
comparison
equal
deleted
inserted
replaced
9284:486b6160962f | 9285:9b16f58c62a7 |
---|---|
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 private static final long serialVersionUID = 1L; | 57 private static final long serialVersionUID = 1L; |
58 | 58 |
59 private final String[] mainvalueLabels; | 59 private final String[] waterlevelLabels; |
60 | 60 |
61 // private final WstInfo wstInfo; | 61 // private final WstInfo wstInfo; |
62 | 62 |
63 private final int maxWaterlevelPdf = 3; | 63 private final int maxWaterlevelPdf = 3; |
64 | 64 |
70 pdf, csv | 70 pdf, csv |
71 } | 71 } |
72 | 72 |
73 public FloodDurationCalculationResult(final String label, final String[] mainvalueLabels, final Collection<ResultRow> rows) { | 73 public FloodDurationCalculationResult(final String label, final String[] mainvalueLabels, final Collection<ResultRow> rows) { |
74 super(label, rows); | 74 super(label, rows); |
75 this.mainvalueLabels = mainvalueLabels; | 75 this.waterlevelLabels = mainvalueLabels; |
76 } | 76 } |
77 | 77 |
78 /** | 78 /** |
79 * Collection of the result rows containing only the rows describing an infrastructure | 79 * Collection of the result rows containing only the rows describing an infrastructure |
80 */ | 80 */ |
92 return Collections.unmodifiableCollection(infrasOnlyRows); | 92 return Collections.unmodifiableCollection(infrasOnlyRows); |
93 } | 93 } |
94 | 94 |
95 @Override | 95 @Override |
96 protected void writeCSVResultMetadata(final ExportContextCSV exportContextCSV) { | 96 protected void writeCSVResultMetadata(final ExportContextCSV exportContextCSV) { |
97 if (this.mainvalueLabels.length >= 1) { | 97 if (this.waterlevelLabels.length >= 1) { |
98 // "##METADATEN WASSERSPIEGELLAGE" | 98 // "##METADATEN WASSERSPIEGELLAGE" |
99 exportContextCSV.writeCSVMetaEntry(SInfoI18NStrings.CSV_META_HEADER_WATERLEVEL); | 99 exportContextCSV.writeCSVMetaEntry(SInfoI18NStrings.CSV_META_HEADER_WATERLEVEL); |
100 for (int i = 1; i <= getWaterlevelCount(); i++) { | 100 for (int i = 1; i <= getWaterlevelCount(); i++) { |
101 // "# Bezeichnung der Wasserspiegellage: " | 101 // "# Bezeichnung der Wasserspiegellage: " |
102 final String label = this.getMainValueLabel(i - 1); | 102 final String label = this.getWaterlevelLabel(i - 1); |
103 exportContextCSV.writeCSVMetaEntry(SInfoI18NStrings.CSV_META_HEADER_WATERLEVEL_NAME, String.format("%d: %s", i, label)); | 103 exportContextCSV.writeCSVMetaEntry(SInfoI18NStrings.CSV_META_HEADER_WATERLEVEL_NAME, String.format("%d: %s", i, label)); |
104 } | 104 } |
105 // "# Bezugspegel: " | 105 // "# Bezugspegel: " |
106 for (final ResultRow row : getRows()) { | 106 for (final ResultRow row : getRows()) { |
107 exportContextCSV.writeCSVMetaEntry(SInfoI18NStrings.CSV_META_HEADER_WATERLEVEL_GAUGE, row.getValue(SInfoResultType.gaugeLabel)); | 107 exportContextCSV.writeCSVMetaEntry(SInfoI18NStrings.CSV_META_HEADER_WATERLEVEL_GAUGE, row.getValue(SInfoResultType.gaugeLabel)); |
230 final StringBuilder builder = new StringBuilder(); | 230 final StringBuilder builder = new StringBuilder(); |
231 return builder.append(rootStr).append("_").append(index).append(hd).toString(); | 231 return builder.append(rootStr).append("_").append(index).append(hd).toString(); |
232 } | 232 } |
233 | 233 |
234 public final int getWaterlevelCount() { | 234 public final int getWaterlevelCount() { |
235 return (this.mainvalueLabels != null) ? this.mainvalueLabels.length : 0; | 235 return (this.waterlevelLabels != null) ? this.waterlevelLabels.length : 0; |
236 } | 236 } |
237 | 237 |
238 public String getMainValueLabel(final int j) { | 238 public String getWaterlevelLabel(final int j) { |
239 if (this.mainvalueLabels != null && j < this.mainvalueLabels.length) | 239 if (this.waterlevelLabels != null && j < this.waterlevelLabels.length) |
240 return this.mainvalueLabels[j]; | 240 return this.waterlevelLabels[j]; |
241 return ""; | 241 return ""; |
242 } | 242 } |
243 | 243 |
244 /** | 244 /** |
245 * Gets the longitudinal section of a result value type for one river side | 245 * Gets the longitudinal section of a result value type for one river side |