changeset 6149:3c8147ba35a6

Bed height: Removed braindead index determination code.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 02 Jun 2013 02:43:00 +0200
parents b12ec9f240bc
children 1f057463765b
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeight.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java
diffstat 2 files changed, 8 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeight.java	Sat Jun 01 20:08:21 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeight.java	Sun Jun 02 02:43:00 2013 +0200
@@ -78,10 +78,8 @@
     }
 
     public double getHeight(double station) {
-        if (this.station.indexOf(station) >= 0) {
-            return this.heights.get(this.station.indexOf(station));
-        }
-        return Double.NaN;
+        int index = this.station.indexOf(station);
+        return index >= 0 ? heights.getQuick(index) : Double.NaN;
     }
 
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java	Sat Jun 01 20:08:21 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java	Sun Jun 02 02:43:00 2013 +0200
@@ -51,25 +51,21 @@
     }
 
     public double getMorphWidth(int idx) {
-        return this.morphWidth.get(idx);
+        return this.morphWidth.getQuick(idx);
     }
 
     public double getDataGap(int idx) {
-        return this.data_gap.get(idx);
+        return this.data_gap.getQuick(idx);
     }
 
     public double getMorphWidth(double station) {
-        if (this.station.indexOf(station) >= 0) {
-            return this.morphWidth.get(this.station.indexOf(station));
-        }
-        return Double.NaN;
+        int index = this.station.indexOf(station);
+        return index >= 0 ? morphWidth.getQuick(index): Double.NaN;
     }
 
     public double getDataGap(double station) {
-        if (this.station.indexOf(station) >= 0) {
-            return this.getDataGap(this.station.indexOf(station));
-        }
-        return Double.NaN;
+        int index = this.station.indexOf(station);
+        return index >= 0 ? data_gap.getQuick(index) : Double.NaN;
     }
 
     public double[] getMorphWidths() {

http://dive4elements.wald.intevation.org