diff gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java @ 454:04cfb4e3da4f

Refactored statistics classes a bit. Added class for vertical cross sections. gnv-artifacts/trunk@503 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 04 Jan 2010 15:20:14 +0000
parents 4cd03910f97e
children b2d2b36b20a0
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Mon Jan 04 13:42:49 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Mon Jan 04 15:20:14 2010 +0000
@@ -362,23 +362,23 @@
             } else if (outputMode.equalsIgnoreCase("statistics")) {
                 log.debug("Statistics will be generated.");
 
-                Statistics s = getStatisticsGenerator();
-
                 Collection<StatisticSet> statistics;
 
-                Object result = getChartResult(uuid, callContext);
+                Statistics s      = getStatisticsGenerator();
+                Object     result = getChartResult(uuid, callContext);
 
-                if (result instanceof Collection) {
-                    Collection<Result> chartResult =
-                        (Collection<Result>) result;
+                if (result != null && s != null) {
                     Collection<KeyValueDescibeData> parameters = 
-                                                    this.getParameters(uuid);
+                        getParameters(uuid);
+
                     Collection<KeyValueDescibeData> measurements = 
-                                                    this.getMeasurements(uuid);
+                        getMeasurements(uuid);
+
                     Collection<KeyValueDescibeData> dates = 
-                                                    this.getDates(uuid);
+                         getDates(uuid);
+
                     statistics = s.calculateStatistics(
-                        chartResult,
+                        result,
                         parameters,
                         measurements,
                         dates);
@@ -387,8 +387,10 @@
                     statistics = new ArrayList<StatisticSet>();
                 }
 
-                Document doc = this.writeStatistics2XML(statistics);
-                this.writeDocument2OutputStream(doc, outputStream);
+                Document doc = writeStatistics2XML(statistics);
+
+                writeDocument2OutputStream(doc, outputStream);
+
             } else if (outputMode.equalsIgnoreCase("odv")) {
                 
                 Collection<Result> odvResult = this.getODVResult(uuid);

http://dive4elements.wald.intevation.org