changeset 8651:81a8e3043794

Improve coding style in KMFilter loops
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 31 Mar 2015 17:28:27 +0200
parents dcdccd59c3be
children 22f01b7e802e
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/WKmsImpl.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WKmsImpl.java	Tue Mar 31 17:27:20 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WKmsImpl.java	Tue Mar 31 17:28:27 2015 +0200
@@ -112,8 +112,8 @@
     @Override
     public WKms filteredKms(double from, double to) {
         WKmsImpl retval = new WKmsImpl(getName());
-        for (int i = 0; i < size(); i++) {
-            double km = kms.getQuick(i);
+        for (int i = 0, S = size(); i < S; i++) {
+            double km = getKm(i);
             if (km >= from && km <= to) {
                 retval.add(km, getW(i));
             }
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java	Tue Mar 31 17:27:20 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java	Tue Mar 31 17:28:27 2015 +0200
@@ -140,10 +140,10 @@
     @Override
     public WKms filteredKms(double from, double to) {
         WQKms retval = new WQKms(getName());
-        for (int i = 0; i < size(); i++) {
-            double km = kms.getQuick(i);
+        for (int i = 0, S = size(); i < S; i++) {
+            double km = getKm(i);
             if (km >= from && km <= to) {
-                retval.add(ws.getQuick(i), qs.getQuick(i), km);
+                retval.add(getW(i), getQ(i), km);
             }
         }
         return retval;

http://dive4elements.wald.intevation.org