Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VerticalCrossSectionStatistics.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 | |
children | b1f5f2a8840f |
rev | line source |
---|---|
454
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.statistics; |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import java.util.Collection; |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 import java.util.ArrayList; |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 import org.apache.log4j.Logger; |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 import de.intevation.gnv.state.describedata.KeyValueDescibeData; |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 import de.intevation.gnv.statistics.exception.StatisticsException; |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.gnv.math.AttributedXYColumns; |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 /** |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 */ |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 public class VerticalCrossSectionStatistics |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 extends AbstractStatistics |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 { |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 private static Logger log = Logger.getLogger( |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 VerticalCrossSectionStatistics.class); |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 public VerticalCrossSectionStatistics() { |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 } |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 public Collection<StatisticSet> calculateStatistics( |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 Object result, |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 Collection<KeyValueDescibeData> parameters, |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 Collection<KeyValueDescibeData> measurements, |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 Collection<KeyValueDescibeData> dates |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 ) |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 throws StatisticsException { |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 boolean debug = log.isDebugEnabled(); |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 if (debug) { |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 log.debug("calculateStatistics --------------"); |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 } |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 ArrayList<StatisticSet> statisticSet = |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 new ArrayList<StatisticSet>(); |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 if (!(result instanceof AttributedXYColumns)) { |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 log.error("wrong type of result"); |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 return statisticSet; |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 } |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 AttributedXYColumns columns = (AttributedXYColumns)result; |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 return statisticSet; |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 } |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
51 } |
04cfb4e3da4f
Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |