Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataValueFilter.java @ 8053:72760ca2fc2b
Sediment load: dispatch calculation modes.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 18 Jul 2014 11:58:59 +0200 |
parents | 1de6256c9786 |
children | cd35b76f1ef8 |
comparison
equal
deleted
inserted
replaced
8052:1dae69eff79d | 8053:72760ca2fc2b |
---|---|
96 public static final class TimeRangeIntersects implements Filter { | 96 public static final class TimeRangeIntersects implements Filter { |
97 | 97 |
98 private Date a; | 98 private Date a; |
99 private Date b; | 99 private Date b; |
100 | 100 |
101 public TimeRangeIntersects(int startYear, int endYear) { | |
102 this(firstJan(Math.min(startYear, endYear)), | |
103 lastDec(Math.max(startYear, endYear))); | |
104 } | |
105 | |
106 private static Date firstJan(int year) { | |
107 Calendar cal = Calendar.getInstance(); | |
108 cal.set(year, 1, 1, 0, 0, 0); | |
109 return cal.getTime(); | |
110 } | |
111 | |
112 private static Date lastDec(int year) { | |
113 Calendar cal = Calendar.getInstance(); | |
114 cal.set(year, 12, 31, 23, 59, 59); | |
115 return cal.getTime(); | |
116 } | |
117 | |
101 public TimeRangeIntersects(Date a, Date b) { | 118 public TimeRangeIntersects(Date a, Date b) { |
102 if (a.after(b)) { | 119 if (a.after(b)) { |
103 this.b = a; | 120 this.b = a; |
104 this.a = b; | 121 this.a = b; |
105 } else { | 122 } else { |