diff backend/src/main/java/org/dive4elements/river/model/BedHeightValueType.java @ 8964:45f1ad66560e

Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
author gernotbelger
date Thu, 29 Mar 2018 15:48:17 +0200
parents
children ecadc9ed0ba0
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/backend/src/main/java/org/dive4elements/river/model/BedHeightValueType.java	Thu Mar 29 15:48:17 2018 +0200
@@ -0,0 +1,39 @@
+/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
+ * 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)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+package org.dive4elements.river.model;
+
+/**
+ * Enumerations that allows to access min/max/mean value of {@link BedHeight} in the same way.
+ *
+ * @author Gernot Belger
+ *
+ */
+public enum BedHeightValueType {
+    min {
+        @Override
+        public Double getValue(final BedHeightValue bedheightValue) {
+            return bedheightValue.getMinHeight();
+        }
+    },
+    max {
+        @Override
+        public Double getValue(final BedHeightValue bedheightValue) {
+            return bedheightValue.getMaxHeight();
+        }
+    },
+    value {
+        @Override
+        public Double getValue(final BedHeightValue bedheightValue) {
+            return bedheightValue.getHeight();
+        }
+    };
+
+    public abstract Double getValue(final BedHeightValue bedheightValue);
+}
\ No newline at end of file

http://dive4elements.wald.intevation.org