diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/predefinedflowdepth/PredefinedFlowDepthColumnAccess.java @ 9035:c16e90a0baf7

Added datacage select and chart display for modelled flow depth series loaded from database
author mschaefer
date Mon, 30 Apr 2018 16:00:12 +0200
parents
children 611a523fc42f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/predefinedflowdepth/PredefinedFlowDepthColumnAccess.java	Mon Apr 30 16:00:12 2018 +0200
@@ -0,0 +1,68 @@
+/** 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.artifacts.sinfo.predefinedflowdepth;
+
+import org.apache.commons.lang.math.DoubleRange;
+import org.dive4elements.river.artifacts.D4EArtifact;
+import org.dive4elements.river.artifacts.access.RangeAccess;
+
+/**
+ * Access to the database loaded flow depth column artifact data
+ *
+ * @author Matthias Schäfer
+ */
+final class PredefinedFlowDepthColumnAccess extends RangeAccess {
+
+    /***** FIELDS *****/
+
+    private Integer columnId;
+
+    private Integer seriesId;
+
+    private String name;
+
+
+    /***** CONSTRUCTORS *****/
+
+    public PredefinedFlowDepthColumnAccess(final D4EArtifact artifact) {
+        super(artifact);
+    }
+
+
+    /***** METHDOS *****/
+
+    public DoubleRange getRange() {
+        final double from = getFrom();
+        final double to = getTo();
+        return new DoubleRange(from, to);
+    }
+
+    public Integer getSeriesId() {
+        if (this.seriesId == null) {
+            this.seriesId = getInteger("flowdepth_id");
+        }
+        return this.columnId;
+    }
+
+    public Integer getColumnId() {
+        if (this.columnId == null) {
+            this.columnId = getInteger("flowdepth_col_id");
+        }
+        return this.columnId;
+    }
+
+    public String getName() {
+        if (this.name == null) {
+            this.name = getString("name");
+        }
+        return this.name;
+    }
+}
\ No newline at end of file

http://dive4elements.wald.intevation.org