diff backend/src/main/java/org/dive4elements/river/model/River.java @ 8756:26dedebbe39f

(issue1801) Code cleanups Remove one indirecton level around RiverUtils.getGauge and remove the old and now unused determineGauge method.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 24 Jun 2015 15:49:23 +0200
parents 30b1ddadf275
children d5917ff74d8a
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/model/River.java	Wed Jun 24 14:07:26 2015 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/River.java	Wed Jun 24 15:49:23 2015 +0200
@@ -356,39 +356,6 @@
         return minmax;
     }
 
-
-    /**
-     * This method returns the first gauge that is intersected by <i>a</i> and
-     * <i>b</i>, but which possibly does not ends with a or starts with b.
-     *
-     * @param a A start point.
-     * @param b An end point.
-     *
-     * @return the first intersecting gauge that does not border with a or b,
-     * the first intersecting gauge if that is impossible.
-     */
-    public Gauge determineGauge(double a, double b) {
-        List<Gauge> gauges = determineGauges(a, b);
-
-        if (a > b) {
-            for (int i = gauges.size() - 1; i >= 0; i--) {
-                Gauge g = gauges.get(i);
-                if (KM_CMP.compare(g.getRange().getA().doubleValue(), a) == 0)
-                    continue;
-                return g;
-            }
-        }
-
-        for (Gauge g: gauges) {
-            if (KM_CMP.compare(g.getRange().getB().doubleValue(), a) == 0) {
-                continue;
-            }
-            return g;
-        }
-
-        return null;
-    }
-
     /**
      * Determine reference gauge dependent on direction of calculation
      * for a range calculation, otherwise dependent on flow direction.

http://dive4elements.wald.intevation.org