Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/AbstractSInfoCalculationResults.java @ 8980:b194fa64506a
SINFO - show results themes according to spec, either raw data or floating mean values.
Some improvements to error handling and handling of empty results.
author | gernotbelger |
---|---|
date | Thu, 05 Apr 2018 18:30:34 +0200 |
parents | a4f1ac81f26d |
children | 50cc99579a46 |
comparison
equal
deleted
inserted
replaced
8979:951a4af24a09 | 8980:b194fa64506a |
---|---|
13 import java.util.ArrayList; | 13 import java.util.ArrayList; |
14 import java.util.Collections; | 14 import java.util.Collections; |
15 import java.util.List; | 15 import java.util.List; |
16 | 16 |
17 import org.apache.commons.lang.math.DoubleRange; | 17 import org.apache.commons.lang.math.DoubleRange; |
18 import org.dive4elements.river.artifacts.model.Calculation; | |
18 import org.dive4elements.river.artifacts.sinfo.util.RiverInfo; | 19 import org.dive4elements.river.artifacts.sinfo.util.RiverInfo; |
19 | 20 |
20 /** | 21 /** |
21 * @author Gernot Belger | 22 * @author Gernot Belger |
22 */ | 23 */ |
55 | 56 |
56 public final DoubleRange getCalcRange() { | 57 public final DoubleRange getCalcRange() { |
57 return this.calcRange; | 58 return this.calcRange; |
58 } | 59 } |
59 | 60 |
60 public final void addResult(final RESULT result) { | 61 public final void addResult(final RESULT result, final Calculation problems) { |
62 /* we assume error reporting was already done in this case */ | |
63 if (result == null) | |
64 return; | |
65 | |
66 if (result.isEmpty()) { | |
67 problems.addProblem("abstractsinfocalculationresults.emptyResult", result.getLabel()); | |
68 return; | |
69 } | |
70 | |
61 this.results.add(result); | 71 this.results.add(result); |
62 } | 72 } |
63 | 73 |
64 public final List<RESULT> getResults() { | 74 public final List<RESULT> getResults() { |
65 return Collections.unmodifiableList(this.results); | 75 return Collections.unmodifiableList(this.results); |