diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/DurationWaterlevel.java @ 9145:e6b63b2b41b9

sinfo.flood_duration pdf, csv, ui
author gernotbelger
date Tue, 12 Jun 2018 10:23:23 +0200
parents
children 3dae6b78e1da
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/flood_duration/DurationWaterlevel.java	Tue Jun 12 10:23:23 2018 +0200
@@ -0,0 +1,66 @@
+/** 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.flood_duration;
+
+import java.io.Serializable;
+import java.text.NumberFormat;
+
+/**
+ * @author Domenico Nardi Tironi
+ *
+ */
+public class DurationWaterlevel implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private final double w;
+    private final double q;
+    private final String bezeichnung;
+    private final int floodDurDaysPerYear;
+
+    public DurationWaterlevel(final double w, final int floodDurDaysPerYear, final double q, final String bezeichnung) {
+        this.w = w;
+        this.q = q;
+        this.bezeichnung = bezeichnung;
+        this.floodDurDaysPerYear = floodDurDaysPerYear;
+    }
+
+    public String getFloodDurDaysPerYearFormatted() {
+        return String.valueOf(this.floodDurDaysPerYear);
+    }
+
+    public String getBezeichnung() {
+        return this.bezeichnung;
+    }
+
+    public String getQFormatted(final NumberFormat qFormatter) {
+        return qFormatter.format(this.q);
+    }
+
+    public String getWFormatted(final NumberFormat wFormatter) {
+        return wFormatter.format(this.w);
+    }
+
+    public static final String getHeaderQ() {
+        return "sinfo.flood_duration.header.q_index"; // kein extra-String für pdf
+    }
+
+    public static final String getHeaderW() {
+        return "sinfo.flood_duration.header.pdf.w_index";
+    }
+
+    public static final String getHeaderBezeichn() {
+        return "sinfo.flood_duration.header.pdf.bezeichnung_index";
+    }
+
+    public static final String getHeaderFloodDurPerYear() {
+        return "sinfo.flood_duration.header.pdf.fd_per_year_index";
+    }
+}

http://dive4elements.wald.intevation.org