comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataValueFilter.java @ 8238:be3c11bef6e8

(issue1448) Finally use the sq time interval as filter in the calculation.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 08 Sep 2014 19:01:26 +0200
parents a1ceacf15d3a
children b207eeb66edd
comparison
equal deleted inserted replaced
8237:25c3a62863d2 8238:be3c11bef6e8
108 cal.setTime(value.getLoad().getStartTime()); 108 cal.setTime(value.getLoad().getStartTime());
109 return cal.get(Calendar.YEAR) == year; 109 return cal.get(Calendar.YEAR) == year;
110 } 110 }
111 } // class Year 111 } // class Year
112 112
113 public static final class SQTimeInterval implements Filter {
114
115 private int sqTiId;
116
117 public SQTimeInterval(int sqTiId) {
118 this.sqTiId = sqTiId;
119 }
120
121 @Override
122 public boolean accept(Value value) {
123 if (sqTiId == 0) {
124 /* Nothing set, nothing filtered */
125 return true;
126 }
127 if (value.getLoad().getSQRelationTimeIntervalId() == 0) {
128 /* Loads without sqRelationTimeInterval are "Schwebstoffe" and should
129 * be included. */
130 return true;
131 }
132 /* All other values should be filtered accordingly. */
133 return value.getLoad().getSQRelationTimeIntervalId() == sqTiId;
134 }
135 } // class SQTimeInterval
136
113 public static final class IsEpoch implements Filter { 137 public static final class IsEpoch implements Filter {
114 138
115 public static final IsEpoch INSTANCE = new IsEpoch(); 139 public static final IsEpoch INSTANCE = new IsEpoch();
116 140
117 private IsEpoch() { 141 private IsEpoch() {

http://dive4elements.wald.intevation.org