diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java @ 2256:dd93a8e1377a

First steps to serve the data in cm if we are are gauges only. flys-artifacts/trunk@3910 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 03 Feb 2012 18:03:26 +0000
parents 9dc81827b187
children 3973a2451cf7
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java	Fri Feb 03 15:22:56 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java	Fri Feb 03 18:03:26 2012 +0000
@@ -16,9 +16,17 @@
         protected WW       ww;
 
         public ApplyFunctionIterator(WW ww) {
+            this(ww, Identity.IDENTITY, Identity.IDENTITY);
+        }
+
+        public ApplyFunctionIterator(
+            WW       ww, 
+            Function function1,
+            Function function2
+        ) {
             this.ww        = ww;
-            this.function1 = Identity.IDENTITY;
-            this.function2 = Identity.IDENTITY;
+            this.function1 = function1;
+            this.function2 = function2;
         }
 
         public boolean hasNext() {
@@ -52,6 +60,9 @@
     protected double startKm;
     protected double endKm;
 
+    protected Double startDatum;
+    protected Double endDatum;
+
     public WW() {
     }
 
@@ -70,16 +81,20 @@
 
     public WW(
         String    name, 
-        double    startKm, 
+        double    startKm,
+        Double    startDatum,
         double [] ws, 
         double    endKm,
+        Double    endDatum,
         double [] ws2
     ) {
-        this.name    = name;
-        this.ws      = new TDoubleArrayList(ws);
-        this.ws2     = new TDoubleArrayList(ws2);
-        this.startKm = startKm;
-        this.endKm   = endKm;
+        this.name       = name;
+        this.ws         = new TDoubleArrayList(ws);
+        this.ws2        = new TDoubleArrayList(ws2);
+        this.startKm    = startKm;
+        this.startDatum = startDatum;
+        this.endKm      = endKm;
+        this.endDatum   = endDatum;
     }
 
     public WW(String name, TDoubleArrayList ws, TDoubleArrayList ws2) {
@@ -133,6 +148,30 @@
         this.endKm = endKm;
     }
 
+    public Double getStartDatum() {
+        return startDatum;
+    }
+
+    public boolean startAtGauge() {
+        return startDatum != null;
+    }
+
+    public boolean endAtGauge() {
+        return endDatum != null;
+    }
+
+    public void setStartDatum(Double startDatum) {
+        this.startDatum = startDatum;
+    }
+
+    public Double getEndDatum() {
+        return endDatum;
+    }
+
+    public void setEndDatum(Double endDatum) {
+        this.endDatum = endDatum;
+    }
+
     @Override
     public void removeNaNs() {
         removeNaNs(new TDoubleArrayList [] { ws, ws2 });

http://dive4elements.wald.intevation.org