Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataValueFilter.java @ 8055:cd35b76f1ef8
Sediment load. More off year based calculations.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 18 Jul 2014 13:03:28 +0200 |
parents | 72760ca2fc2b |
children | 25feef564d09 |
comparison
equal
deleted
inserted
replaced
8054:db4e6bd367a6 | 8055:cd35b76f1ef8 |
---|---|
18 public final class SedimentLoadDataValueFilter { | 18 public final class SedimentLoadDataValueFilter { |
19 | 19 |
20 private SedimentLoadDataValueFilter() { | 20 private SedimentLoadDataValueFilter() { |
21 } | 21 } |
22 | 22 |
23 public static final class Not implements Filter { | |
24 | |
25 private Filter parent; | |
26 | |
27 public Not(Filter parent) { | |
28 this.parent = parent; | |
29 } | |
30 | |
31 @Override | |
32 public boolean accept(Value value) { | |
33 return !parent.accept(value); | |
34 } | |
35 } // class Not | |
36 | |
23 public static abstract class Composite implements Filter { | 37 public static abstract class Composite implements Filter { |
24 protected List<Filter> filters; | 38 protected List<Filter> filters; |
25 | 39 |
26 public Composite() { | 40 public Composite() { |
27 filters = new ArrayList<Filter>(); | 41 filters = new ArrayList<Filter>(); |
28 } | 42 } |
29 | 43 |
30 public void add(Filter filter) { | 44 public Composite add(Filter filter) { |
31 filters.add(filter); | 45 filters.add(filter); |
46 return this; | |
32 } | 47 } |
33 } | 48 } |
34 | 49 |
35 public static final class And extends Composite { | 50 public static final class And extends Composite { |
36 | 51 |
96 public static final class TimeRangeIntersects implements Filter { | 111 public static final class TimeRangeIntersects implements Filter { |
97 | 112 |
98 private Date a; | 113 private Date a; |
99 private Date b; | 114 private Date b; |
100 | 115 |
116 public TimeRangeIntersects(int year) { | |
117 this(year, year); | |
118 } | |
119 | |
101 public TimeRangeIntersects(int startYear, int endYear) { | 120 public TimeRangeIntersects(int startYear, int endYear) { |
102 this(firstJan(Math.min(startYear, endYear)), | 121 this(firstJan(Math.min(startYear, endYear)), |
103 lastDec(Math.max(startYear, endYear))); | 122 lastDec(Math.max(startYear, endYear))); |
104 } | 123 } |
105 | 124 |