Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java @ 97:fce237b6fdb8
Bug fixed. Now all Values will be used to calculate the Statistics
gnv-artifacts/trunk@143 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Mon, 28 Sep 2009 09:53:17 +0000 |
parents | 13402ac8d8fe |
children | 156db25ad4b4 |
comparison
equal
deleted
inserted
replaced
96:4241af6ae374 | 97:fce237b6fdb8 |
---|---|
59 DescriptiveStatistics lStatistics = null; | 59 DescriptiveStatistics lStatistics = null; |
60 SimpleRegression lRegression = null; | 60 SimpleRegression lRegression = null; |
61 statistics = new ArrayList<Statistic>(); | 61 statistics = new ArrayList<Statistic>(); |
62 int break1, break2; | 62 int break1, break2; |
63 int lSeries = 1; | 63 int lSeries = 1; |
64 if (sDebug) log.debug("TimeseriesStatistics() lImageFile != null"); | |
65 try{ | 64 try{ |
66 | 65 |
67 Iterator<Result> resultIterator = resultSet.iterator(); | 66 Iterator<Result> resultIterator = resultSet.iterator(); |
68 if (resultIterator.hasNext()){ | 67 if (resultIterator.hasNext()){ |
69 Result row = resultIterator.next(); | 68 Result row = resultIterator.next(); |
73 lStatistics = DescriptiveStatistics.newInstance(); | 72 lStatistics = DescriptiveStatistics.newInstance(); |
74 while (resultIterator.hasNext()) { | 73 while (resultIterator.hasNext()) { |
75 | 74 |
76 if (break1 != row.getInteger("GROUP1") | 75 if (break1 != row.getInteger("GROUP1") |
77 || break2 != row.getInteger("GROUP2")) { | 76 || break2 != row.getInteger("GROUP2")) { |
78 | |
79 addStatisticsValues(lStatistics, lRegression, lSeries); | 77 addStatisticsValues(lStatistics, lRegression, lSeries); |
80 | 78 |
81 lStatistics.clear(); | 79 lStatistics.clear(); |
82 lRegression.clear(); | 80 lRegression.clear(); |
83 | 81 |
84 row = resultIterator.next(); | |
85 lStatistics.addValue(row.getDouble("YORDINATE")); | 82 lStatistics.addValue(row.getDouble("YORDINATE")); |
86 Double x = new Double( (row.getDate("XORDINATE")).getTime()/1000/3600) ; | 83 Double x = new Double( (row.getDate("XORDINATE")).getTime()/1000/3600) ; |
87 lRegression.addData(x ,row.getDouble("YORDINATE")); | 84 lRegression.addData(x ,row.getDouble("YORDINATE")); |
88 | 85 |
89 break1 = row.getInteger("GROUP1"); | 86 break1 = row.getInteger("GROUP1"); |
90 break2 = row.getInteger("GROUP2"); | 87 break2 = row.getInteger("GROUP2"); |
88 row = resultIterator.next(); | |
91 lSeries ++; | 89 lSeries ++; |
92 } | 90 } |
93 else{ | 91 else{ |
94 row = resultIterator.next(); | 92 |
95 lStatistics.addValue(row.getDouble("YORDINATE")); | 93 lStatistics.addValue(row.getDouble("YORDINATE")); |
96 Double x = new Double( (row.getDate("XORDINATE")).getTime()/1000/3600) ; | 94 Double x = new Double( (row.getDate("XORDINATE")).getTime()/1000/3600) ; |
97 lRegression.addData(x,row.getDouble("YORDINATE")); | 95 lRegression.addData(x,row.getDouble("YORDINATE")); |
96 row = resultIterator.next(); | |
98 } | 97 } |
99 | 98 |
100 } | 99 } |
101 addStatisticsValues(lStatistics, lRegression,lSeries); | 100 addStatisticsValues(lStatistics, lRegression,lSeries); |
102 lStatistics.clear(); | 101 lStatistics.clear(); |