Mercurial > dive4elements > river
changeset 154:03362976fa0f
DischargeTables: Cache the scale, too. Otherwise two calls to getValues() with different arguments will result in the same output.
flys-artifacts/trunk@1591 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 28 Mar 2011 15:21:27 +0000 (2011-03-28) |
parents | c97f9bc9b642 |
children | fbbb22e1e206 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java |
diffstat | 2 files changed, 16 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Mon Mar 28 14:33:36 2011 +0000 +++ b/flys-artifacts/ChangeLog Mon Mar 28 15:21:27 2011 +0000 @@ -1,3 +1,9 @@ +2011-03-28 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java: + Cache the scale, too. Otherwise two calls to getValues() with + different arguments will result in the same output. + 2011-03-28 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java: @@ -16,6 +22,11 @@ 2011-03-28 Sascha L. Teichmann <sascha.teichmann@intevation.de> + * src/main/java/de/intevation/flys/importer/PegelGltParser.java: + Fixed swap of operands. + +2011-03-28 Sascha L. Teichmann <sascha.teichmann@intevation.de> + * src/main/java/de/intevation/flys/artifacts/model/GaugesFactory.java: New. Load gauges for a river and filter them for given ranges.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java Mon Mar 28 14:33:36 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java Mon Mar 28 15:21:27 2011 +0000 @@ -28,6 +28,8 @@ protected String riverName; + protected double scale; + protected Map<String, double [][]> values; public DischargeTables() { @@ -38,13 +40,15 @@ } public DischargeTables(String riverName, List<String> gaugeNames) { + scale = Double.NaN; this.riverName = riverName; this.gaugeNames = gaugeNames; } public Map<String, double [][]> getValues(double scale) { - if (values == null) { + if (values == null || scale != this.scale) { values = loadValues(scale); + this.scale = scale; } return values; }