diff artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java @ 8169:856701739443

Handle missing years in bed height differences without assuming an unknown year to be BC 1.
author "Tom Gottfried <tom@intevation.de>"
date Mon, 01 Sep 2014 09:43:55 +0200
parents 76b5add4f268
children 5c3b36b519d0
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java	Fri Aug 29 17:00:26 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java	Mon Sep 01 09:43:55 2014 +0200
@@ -15,25 +15,23 @@
 public class BedDiffYearResult
 extends BedDifferencesResult
 {
-    protected TDoubleArrayList bedHeights;
+    protected TDoubleArrayList diffsPerYear;
     protected TDoubleArrayList dataGap;
     protected TDoubleArrayList soundingWidth;
     protected TDoubleArrayList morphWidth1;
     protected TDoubleArrayList morphWidth2;
-    protected int start;
-    protected int end;
+    protected Integer start;
+    protected Integer end;
     protected String nameFirst;
     protected String nameSecond;
 
     public BedDiffYearResult () {
         super();
-        this.bedHeights = new TDoubleArrayList();
+        this.diffsPerYear = new TDoubleArrayList();
         this.dataGap = new TDoubleArrayList();
         this.soundingWidth = new TDoubleArrayList();
         this.morphWidth1 = new TDoubleArrayList();
         this.morphWidth2 = new TDoubleArrayList();
-        this.start = -1;
-        this.end = -1;
     }
 
     /**
@@ -41,7 +39,7 @@
      * @param differences the height differences
      * @param heights1 the heights
      * @param heights2 the other heights
-     * @param bedHeights the differences normalized per year in m.
+     * @param diffsPerYear the differences normalized per year in cm.
      */
     public BedDiffYearResult(
         TDoubleArrayList kms,
@@ -51,15 +49,15 @@
         TDoubleArrayList morphWidth1,
         TDoubleArrayList morphWidth2,
         TDoubleArrayList soundingWidth,
-        TDoubleArrayList bedHeights,
+        TDoubleArrayList diffsPerYear,
         TDoubleArrayList dataGap,
-        int start,
-        int end,
+        Integer start,
+        Integer end,
         String nameFirst,
         String nameSecond
     ) {
         super(kms, differences, heights1, heights2);
-        this.bedHeights = bedHeights;
+        this.diffsPerYear = diffsPerYear;
         this.dataGap = dataGap;
         this.soundingWidth = soundingWidth;
         this.morphWidth1 = morphWidth1;
@@ -71,7 +69,7 @@
     }
 
     public TDoubleArrayList getBedHeights() {
-        return this.bedHeights;
+        return this.diffsPerYear;
     }
 
     public TDoubleArrayList getDataGap() {
@@ -90,7 +88,7 @@
         return this.soundingWidth;
     }
 
-    public int getStart() {
+    public Integer getStart() {
         return this.start;
     }
 
@@ -102,7 +100,7 @@
         this.end = value;
     }
 
-    public int getEnd() {
+    public Integer getEnd() {
         return this.end;
     }
 
@@ -129,7 +127,7 @@
     }
 
     public void addBedHeights(double value) {
-        this.bedHeights.add(value);
+        this.diffsPerYear.add(value);
     }
 
     public double[][] getMorphWidth1Data() {
@@ -156,7 +154,7 @@
     public double[][] getHeightPerYearData() {
         return new double[][] {
             kms.toNativeArray(),
-            bedHeights.toNativeArray()
+            diffsPerYear.toNativeArray()
         };
     }
 

http://dive4elements.wald.intevation.org