Mercurial > dive4elements > river
changeset 4585:b4a95290ec63
Refactor ComputedDischargeCurveExporter to support WQKms values and WQKms arrays
Not only allow CalculationResult objects in ComputedDischargeCurveExporter. Also
generate exports from WQKms values and WQKms arrays.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Tue, 27 Nov 2012 17:41:41 +0100 |
parents | 9745f37c0d52 |
children | 319565a48182 |
files | flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveExporter.java |
diffstat | 1 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveExporter.java Tue Nov 27 17:39:38 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveExporter.java Tue Nov 27 17:41:41 2012 +0100 @@ -76,10 +76,16 @@ protected void addData(Object d) { if (d instanceof CalculationResult) { d = ((CalculationResult)d).getData(); - if (d instanceof WQKms []) { - data.addAll(Arrays.asList((WQKms [])d)); - } } + if (d instanceof WQKms[]){ + data.addAll(Arrays.asList((WQKms [])d)); + return; + } + else if (d instanceof WQKms) { + data.add((WQKms)d); + } + logger.warn("Can't add data for csv export. Unkown data type " + + d.getClass().getName()); }