diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/FlowDepthCalculationResult.java @ 8877:9f7a285b0ee3

Some work on SINFO FlowDepth
author gernotbelger
date Thu, 08 Feb 2018 18:48:24 +0100
parents 7bbfb24e6eec
children 7a8c12706834
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/FlowDepthCalculationResult.java	Thu Feb 08 18:47:36 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/FlowDepthCalculationResult.java	Thu Feb 08 18:48:24 2018 +0100
@@ -1,6 +1,6 @@
 /* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
- * Software engineering by 
- *  Björnsen Beratende Ingenieure GmbH 
+ * Software engineering by
+ *  Björnsen Beratende Ingenieure GmbH
  *  Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
  *
  * This file is Free Software under the GNU AGPL (>=v3)
@@ -23,46 +23,53 @@
  */
 class FlowDepthCalculationResult
 implements Serializable {
-	
-	private static final long serialVersionUID = 1L;
-
-	private final Collection<FlowDepthRow> rows = new ArrayList<>();
-
-	private final String wstLabel;
-	
-	private final String soundingLabel;
-
-	public FlowDepthCalculationResult(final String wstLabel, final String soundingLabel) {
-		this.wstLabel = wstLabel;
-		this.soundingLabel = soundingLabel;
-	}
 
-	public void addRow(double station, double flowDepth, double flowDepthWithTkh, double tkh, double waterlevel, double discharge, String waterlevelLabel, String gauge, double meanBedHeight, String sondageLabel, String location) {
-		rows.add(new FlowDepthRow(station, flowDepth, flowDepthWithTkh, tkh, waterlevel, discharge, waterlevelLabel, gauge, meanBedHeight, sondageLabel, location));
-	}
-	
-	public String getWstLabel() {
-		return this.wstLabel;
-	}
+    private static final long serialVersionUID = 1L;
 
-	public String getSoundingLabel() {
-		return this.soundingLabel;
-	}
+    private final Collection<FlowDepthRow> rows = new ArrayList<>();
 
-	public Collection<FlowDepthRow> getRows() {
-		return  Collections.unmodifiableCollection( rows );
-	}
-	
+    private final String label;
+
+    private final BedHeightInfo sounding;
+
+    private final WstInfo wst;
+
+    public FlowDepthCalculationResult(final String label, final WstInfo wst, final BedHeightInfo sounding) {
+        this.label = label;
+        this.wst = wst;
+        this.sounding = sounding;
+    }
+
+    public void addRow(final double station, final double flowDepth, final double flowDepthWithTkh, final double tkh, final double waterlevel, final double discharge, final String waterlevelLabel, final String gauge, final double meanBedHeight, final String sondageLabel, final String location) {
+        this.rows.add(new FlowDepthRow(station, flowDepth, flowDepthWithTkh, tkh, waterlevel, discharge, waterlevelLabel, gauge, meanBedHeight, sondageLabel, location));
+    }
+
+    public String getLabel() {
+        return this.label;
+    }
+
+    public WstInfo getWst() {
+        return this.wst;
+    }
+
+    public BedHeightInfo getSounding() {
+        return this.sounding;
+    }
+
+    public Collection<FlowDepthRow> getRows() {
+        return  Collections.unmodifiableCollection( this.rows );
+    }
+
     public double[][] getFlowDepthPoints() {
 
-    	TDoubleArrayList xPoints = new TDoubleArrayList(rows.size());
-    	TDoubleArrayList yPoints = new TDoubleArrayList(rows.size());
-    	
-        for (FlowDepthRow row : rows) {
-        	xPoints.add(row.getStation());
-			yPoints.add(row.getFlowDepth());
-		}
-        
+        final TDoubleArrayList xPoints = new TDoubleArrayList(this.rows.size());
+        final TDoubleArrayList yPoints = new TDoubleArrayList(this.rows.size());
+
+        for (final FlowDepthRow row : this.rows) {
+            xPoints.add(row.getStation());
+            yPoints.add(row.getFlowDepth());
+        }
+
         return new double[][] { xPoints.toNativeArray(), yPoints.toNativeArray() };
     }
 }
\ No newline at end of file

http://dive4elements.wald.intevation.org