Mercurial > dive4elements > gnv-client
comparison 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 |
comparison
equal
deleted
inserted
replaced
453:537e663d6c0c | 454:04cfb4e3da4f |
---|---|
360 (Collection<Result>)result); | 360 (Collection<Result>)result); |
361 } | 361 } |
362 } else if (outputMode.equalsIgnoreCase("statistics")) { | 362 } else if (outputMode.equalsIgnoreCase("statistics")) { |
363 log.debug("Statistics will be generated."); | 363 log.debug("Statistics will be generated."); |
364 | 364 |
365 Statistics s = getStatisticsGenerator(); | |
366 | |
367 Collection<StatisticSet> statistics; | 365 Collection<StatisticSet> statistics; |
368 | 366 |
369 Object result = getChartResult(uuid, callContext); | 367 Statistics s = getStatisticsGenerator(); |
370 | 368 Object result = getChartResult(uuid, callContext); |
371 if (result instanceof Collection) { | 369 |
372 Collection<Result> chartResult = | 370 if (result != null && s != null) { |
373 (Collection<Result>) result; | |
374 Collection<KeyValueDescibeData> parameters = | 371 Collection<KeyValueDescibeData> parameters = |
375 this.getParameters(uuid); | 372 getParameters(uuid); |
373 | |
376 Collection<KeyValueDescibeData> measurements = | 374 Collection<KeyValueDescibeData> measurements = |
377 this.getMeasurements(uuid); | 375 getMeasurements(uuid); |
376 | |
378 Collection<KeyValueDescibeData> dates = | 377 Collection<KeyValueDescibeData> dates = |
379 this.getDates(uuid); | 378 getDates(uuid); |
379 | |
380 statistics = s.calculateStatistics( | 380 statistics = s.calculateStatistics( |
381 chartResult, | 381 result, |
382 parameters, | 382 parameters, |
383 measurements, | 383 measurements, |
384 dates); | 384 dates); |
385 } | 385 } |
386 else { | 386 else { |
387 statistics = new ArrayList<StatisticSet>(); | 387 statistics = new ArrayList<StatisticSet>(); |
388 } | 388 } |
389 | 389 |
390 Document doc = this.writeStatistics2XML(statistics); | 390 Document doc = writeStatistics2XML(statistics); |
391 this.writeDocument2OutputStream(doc, outputStream); | 391 |
392 writeDocument2OutputStream(doc, outputStream); | |
393 | |
392 } else if (outputMode.equalsIgnoreCase("odv")) { | 394 } else if (outputMode.equalsIgnoreCase("odv")) { |
393 | 395 |
394 Collection<Result> odvResult = this.getODVResult(uuid); | 396 Collection<Result> odvResult = this.getODVResult(uuid); |
395 this.createODV(outputStream, odvResult); | 397 this.createODV(outputStream, odvResult); |
396 } | 398 } |