Mercurial > dive4elements > river
changeset 3744:b220287a171e
Slightly refactored range with values code to be useful in extreme waterlevels.
flys-artifacts/trunk@5427 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 10 Sep 2012 16:52:15 +0000 |
parents | 51f76225823b |
children | e86cd5176678 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/RangeWithValues.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java |
diffstat | 3 files changed, 12 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Mon Sep 10 15:59:34 2012 +0000 +++ b/flys-artifacts/ChangeLog Mon Sep 10 16:52:15 2012 +0000 @@ -1,3 +1,11 @@ +2012-09-10 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/model/RangeWithValues.java: + Extends Range now. + + * src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java: + Adjusted to use slightly different method names of Range. + 2012-09-10 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/artifacts/model/Range.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/RangeWithValues.java Mon Sep 10 15:59:34 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/RangeWithValues.java Mon Sep 10 16:52:15 2012 +0000 @@ -1,39 +1,20 @@ package de.intevation.flys.artifacts.model; -import java.io.Serializable; - - /** * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ -public class RangeWithValues implements Serializable { +public class RangeWithValues extends Range { - protected double lower; - protected double upper; protected double[] values; - public RangeWithValues() { } - public RangeWithValues(double lower, double upper, double[] values) { - this.lower = lower; - this.upper = upper; + super(lower, upper); this.values = values; } - - public double getLower() { - return lower; - } - - - public double getUpper() { - return upper; - } - - public double[] getValues() { return values; }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java Mon Sep 10 15:59:34 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java Mon Sep 10 16:52:15 2012 +0000 @@ -142,8 +142,6 @@ double rangeFrom = dist[0]; double rangeTo = dist[1]; - int idx = 0; - if (rangeFrom < rangeTo) { Collections.sort(gauges, GAUGE_UP); for (Gauge gauge: gauges) { @@ -329,7 +327,7 @@ double upper = range.getB().doubleValue(); for (RangeWithValues rwv: rwvs) { - if (lower <= rwv.getLower() && upper >= rwv.getUpper()) { + if (lower <= rwv.getStart() && upper >= rwv.getEnd()) { compareWsWithGauge(gauge, rwv.getValues()); } } @@ -361,7 +359,7 @@ double upper = range.getB().doubleValue(); for (RangeWithValues rwv: rwvs) { - if (lower <= rwv.getLower() && upper >= rwv.getUpper()) { + if (lower <= rwv.getStart() && upper >= rwv.getEnd()) { compareQsWithGauge(wst, gauge, rwv.getValues()); } }