changeset 2217:54422e31dc27

Added new model classes which will be used during historical discharge curve calculation. flys-artifacts/trunk@3856 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 01 Feb 2012 12:24:05 +0000
parents 31fa7cae0f35
children 39933df6d0fe
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Timerange.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQTimerange.java
diffstat 3 files changed, 79 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Feb 01 12:21:05 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed Feb 01 12:24:05 2012 +0000
@@ -1,3 +1,12 @@
+2012-02-01  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/Timerange.java: New.
+	  This class might be used to store timeranges. Start and end time are
+	  stores as long (milliseconds since january 1, 1970).
+
+	* src/main/java/de/intevation/flys/artifacts/model/WQTimerange.java:
+	  New. This class should be used to save Ws, Qs and timeranges.
+
 2012-02-01  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/utils/FLYSUtils.java: Added helper
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Timerange.java	Wed Feb 01 12:24:05 2012 +0000
@@ -0,0 +1,33 @@
+package de.intevation.flys.artifacts.model;
+
+import java.io.Serializable;
+
+
+/**
+ * This class represents time ranges specified by start and end time. Start and
+ * end times are stored as long (number of milliseconds since january 1, 1970).
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public class Timerange implements Serializable {
+
+    private long start;
+    private long end;
+
+
+    public Timerange(long start, long end) {
+        this.start = start;
+        this.end   = end;
+    }
+
+
+    public long getStart() {
+        return start;
+    }
+
+
+    public long getEnd() {
+        return end;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQTimerange.java	Wed Feb 01 12:24:05 2012 +0000
@@ -0,0 +1,37 @@
+package de.intevation.flys.artifacts.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public class WQTimerange extends WQ {
+
+    protected List<Timerange> ts;
+
+
+    public WQTimerange() {
+        super("");
+    }
+
+
+    public WQTimerange(String name) {
+        super(name);
+        ts = new ArrayList<Timerange>();
+    }
+
+
+    public void add(double w, double q, Timerange t) {
+        ws.add(w);
+        qs.add(q);
+        ts.add(t);
+    }
+
+
+    public Timerange[] getTimeranges() {
+        return (Timerange[]) ts.toArray();
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org