changeset 6340:fbe2d4c2b2dd

In prep for 1235: Renamed variables for improved readability.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 14 Jun 2013 11:56:18 +0200
parents aef238fdd9b6
children 3ec08ff0f497
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Fri Jun 14 16:56:30 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Fri Jun 14 11:56:18 2013 +0200
@@ -94,13 +94,13 @@
         double[][] sd = getLoadData(result);
 
         // Sort by km.
-        TreeMap<Double, Double> sortData = new TreeMap<Double,Double>();
+        TreeMap<Double, Double> sortedKmLoad = new TreeMap<Double,Double>();
 
         double[] km   = sd[0];
         double[] load = sd[1];
 
         for (int i = 0 ; i < km.length; i++) {
-            sortData.put(km[i], load[i]);
+            sortedKmLoad.put(km[i], load[i]);
         }
 
         double[][] values = new double[2][];
@@ -112,25 +112,25 @@
         // Find station via its station (km).
         // TODO use a binarySearch instead of linear absdiff approach
         int i = 0;
-        for (Map.Entry<Double, Double> entry: sortData.entrySet()) {
+        for (Map.Entry<Double, Double> kmLoad: sortedKmLoad.entrySet()) {
             boolean matchFound = false;
             // For now, ignore overlaps like (B> next A)
             for (MeasurementStation station: stations) {
-                if (Math.abs(station.getStation() - entry.getKey()) < EPSILON ||
-                    station.getRange().containsTolerant(entry.getKey())) {
+                if (Math.abs(station.getStation() - kmLoad.getKey()) < EPSILON ||
+                    station.getRange().containsTolerant(kmLoad.getKey())) {
                     // TODO: In rare cases, two matches can be found.
                     values[0][i*3] = station.getRange().getA().doubleValue() + EPSILON;
-                    values[1][i*3] = entry.getValue();
+                    values[1][i*3] = kmLoad.getValue();
                     values[0][i*3+1] = station.getRange().getB().doubleValue() - EPSILON;
-                    values[1][i*3+1] = entry.getValue();
+                    values[1][i*3+1] = kmLoad.getValue();
                     values[0][i*3+2] = station.getRange().getB().doubleValue();
-                    values[1][i*3+2] = entry.getValue();
+                    values[1][i*3+2] = kmLoad.getValue();
                     matchFound = true;
                 }
             }
             // Store points without match for later assessment.
             if (!matchFound) {
-                logger.warn("measurement without station ("+entry.getKey()+")!");
+                logger.warn("measurement without station ("+kmLoad.getKey()+")!");
             }
             i++;
         }

http://dive4elements.wald.intevation.org