Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisResult.java @ 6891:8efef772a488
FixA: Remapped indices of analysis periods, too. Needs testing!
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Wed, 21 Aug 2013 15:41:58 +0200 |
parents | b410729bdcdd |
children | 3e93f29281bc |
comparison
equal
deleted
inserted
replaced
6889:feaf76b70190 | 6891:8efef772a488 |
---|---|
8 | 8 |
9 package org.dive4elements.river.artifacts.model.fixings; | 9 package org.dive4elements.river.artifacts.model.fixings; |
10 | 10 |
11 import java.util.Collection; | 11 import java.util.Collection; |
12 import java.util.Date; | 12 import java.util.Date; |
13 import java.util.TreeMap; | |
13 import java.util.TreeSet; | 14 import java.util.TreeSet; |
14 | 15 |
15 import org.apache.log4j.Logger; | 16 import org.apache.log4j.Logger; |
16 import org.dive4elements.river.artifacts.model.Parameters; | 17 import org.dive4elements.river.artifacts.model.Parameters; |
17 | 18 |
82 } | 83 } |
83 } | 84 } |
84 return dates; | 85 return dates; |
85 } | 86 } |
86 | 87 |
88 public Collection<Integer> getAnalysisEventsIndices(int analysisPeriod) { | |
89 TreeMap<Date, Integer> dates = new TreeMap<Date, Integer>(); | |
90 for (KMIndex.Entry<AnalysisPeriod []> entry: analysisPeriods) { | |
91 QWD [] qwds = entry.getValue()[analysisPeriod].getQWDs(); | |
92 if (qwds != null) { | |
93 for (QWD qwd: qwds) { | |
94 dates.put(qwd.date, qwd.index); | |
95 } | |
96 } | |
97 } | |
98 return dates.values(); | |
99 } | |
100 | |
101 public void remapAnalysisEventsIndicesToRank(int analysisPeriod) { | |
102 RankRemapper remapper = new RankRemapper(); | |
103 for (Integer index: getAnalysisEventsIndices(analysisPeriod)) { | |
104 remapper.toMap(index); | |
105 } | |
106 for (KMIndex.Entry<AnalysisPeriod []> entry: analysisPeriods) { | |
107 QWD [] qwds = entry.getValue()[analysisPeriod].getQWDs(); | |
108 if (qwds != null) { | |
109 for (QWD qwd: qwds) { | |
110 remapper.remap(qwd); | |
111 } | |
112 } | |
113 } | |
114 } | |
115 | |
87 public KMIndex<AnalysisPeriod []> getAnalysisPeriods() { | 116 public KMIndex<AnalysisPeriod []> getAnalysisPeriods() { |
88 return analysisPeriods; | 117 return analysisPeriods; |
89 } | 118 } |
90 | 119 |
91 public void setAnalysisPeriods(KMIndex<AnalysisPeriod []> analysisPeriods) { | 120 public void setAnalysisPeriods(KMIndex<AnalysisPeriod []> analysisPeriods) { |