Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQDay.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | 4de4b19b6be6 |
children |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
23 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 23 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
24 */ | 24 */ |
25 public class WQDay | 25 public class WQDay |
26 extends WQ | 26 extends WQ |
27 { | 27 { |
28 public static final Comparator<double []> FIRST_CMP = new Comparator<double []>() { | 28 public static final Comparator<double []> FIRST_CMP = |
29 new Comparator<double []>() { | |
29 @Override | 30 @Override |
30 public int compare(double [] a, double [] b) { | 31 public int compare(double [] a, double [] b) { |
31 double diff = a[0] - b[0]; | 32 double diff = a[0] - b[0]; |
32 if (diff < 0d) return -1; | 33 if (diff < 0d) return -1; |
33 if (diff > 0d) return +1; | 34 if (diff > 0d) return +1; |
69 | 70 |
70 public int getDay(int idx) { | 71 public int getDay(int idx) { |
71 return days.getQuick(idx); | 72 return days.getQuick(idx); |
72 } | 73 } |
73 | 74 |
74 private static final Double interpolateX(ArrayList<double []> dxs, double x) { | 75 private static final Double interpolateX( |
75 | 76 ArrayList<double []> dxs, |
77 double x | |
78 ) { | |
76 Collections.sort(dxs, FIRST_CMP); | 79 Collections.sort(dxs, FIRST_CMP); |
77 | 80 |
78 if (Math.abs(x - dxs.get(0)[1]) < EPSILON) { | 81 if (Math.abs(x - dxs.get(0)[1]) < EPSILON) { |
79 return dxs.get(0)[0]; | 82 return dxs.get(0)[0]; |
80 } | 83 } |