Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculationResult.java @ 9215:0fc9c82e744e
work on collison, flood_duration
author | gernotbelger |
---|---|
date | Tue, 03 Jul 2018 17:00:48 +0200 |
parents | 53cc5b496692 |
children | 4e6111f87dda |
comparison
equal
deleted
inserted
replaced
9214:091fd9676496 | 9215:0fc9c82e744e |
---|---|
13 import java.util.ArrayList; | 13 import java.util.ArrayList; |
14 import java.util.Collection; | 14 import java.util.Collection; |
15 import java.util.Collections; | 15 import java.util.Collections; |
16 import java.util.List; | 16 import java.util.List; |
17 | 17 |
18 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; | |
19 import org.dive4elements.river.artifacts.common.AbstractCalculationExportableResult; | 18 import org.dive4elements.river.artifacts.common.AbstractCalculationExportableResult; |
20 import org.dive4elements.river.artifacts.common.AbstractExportContext; | 19 import org.dive4elements.river.artifacts.common.AbstractExportContext; |
21 import org.dive4elements.river.artifacts.common.ExportContextCSV; | 20 import org.dive4elements.river.artifacts.common.ExportContextCSV; |
22 import org.dive4elements.river.artifacts.common.ExportContextPDF; | 21 import org.dive4elements.river.artifacts.common.ExportContextPDF; |
23 import org.dive4elements.river.artifacts.common.GeneralResultType; | 22 import org.dive4elements.river.artifacts.common.GeneralResultType; |
45 private final int waterlevelCount; | 44 private final int waterlevelCount; |
46 // private final WstInfo wstInfo; | 45 // private final WstInfo wstInfo; |
47 private final int maxWaterlevelPdf = 3; | 46 private final int maxWaterlevelPdf = 3; |
48 | 47 |
49 public interface ValueGetter { | 48 public interface ValueGetter { |
50 abstract double getValue(DurationWaterlevel waterlevel); | 49 double getValue(DurationWaterlevel waterlevel); |
51 } | 50 } |
52 | 51 |
53 private enum ExportMode { | 52 private enum ExportMode { |
54 pdf, csv | 53 pdf, csv |
55 } | 54 } |
56 | 55 |
57 public FloodDurationCalculationResult(final String label, final String[] mainvalueLabels, final Collection<ResultRow> rows) { | 56 public FloodDurationCalculationResult(final String label, final String[] mainvalueLabels, final Collection<ResultRow> rows) { |
58 super(label, rows); | 57 super(label, rows); |
59 this.mainvalueLabels = mainvalueLabels; // TODO: löschen (?) | 58 this.mainvalueLabels = mainvalueLabels; |
60 this.waterlevelCount = mainvalueLabels.length; | 59 this.waterlevelCount = mainvalueLabels.length; |
61 } | 60 } |
62 | 61 |
63 /** | 62 /** |
64 * The label of one of the optional main values, or null | 63 * The label of one of the optional main values, or null |
277 if (this.mainvalueLabels != null && j < this.mainvalueLabels.length) | 276 if (this.mainvalueLabels != null && j < this.mainvalueLabels.length) |
278 return this.mainvalueLabels[j]; | 277 return this.mainvalueLabels[j]; |
279 return ""; | 278 return ""; |
280 } | 279 } |
281 | 280 |
282 public final double[][] getMainValueDurationPoints(final DiagramGenerator generator, final ArtifactAndFacet bundle, | 281 public final double[][] getMainValueDurationPoints(final DiagramGenerator generator, final ValueGetter valuegetter, final int dataIndex) { |
283 // final Function<DurationWaterlevel, Double> valueGetter | |
284 final ValueGetter valuegetter, final int dataIndex) { | |
285 | 282 |
286 final TDoubleArrayList xPoints = new TDoubleArrayList(this.rows.size()); | 283 final TDoubleArrayList xPoints = new TDoubleArrayList(this.rows.size()); |
287 final TDoubleArrayList yPoints = new TDoubleArrayList(this.rows.size()); | 284 final TDoubleArrayList yPoints = new TDoubleArrayList(this.rows.size()); |
288 | 285 |
289 for (final ResultRow row : this.rows) { | 286 for (final ResultRow row : this.rows) { |