Mercurial > dive4elements > river
view artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/DurationWaterlevel.java @ 9259:66b003701546
Added infrastructure height and Q annotation to S-Info flood duration curve chart
author | mschaefer |
---|---|
date | Mon, 16 Jul 2018 08:43:07 +0200 |
parents | 4e6111f87dda |
children | 83ebeb620b5a |
line wrap: on
line source
/** 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 double getWaterlevel() { return this.w; } public int getFloodDurDaysPerYear() { return this.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); } // normally, the label is included in the type, but we need to replace the index ("_1") public static final String getHeaderQ() { return "sinfo.flood_duration.header.q_index"; } public static final String getHeaderWPdf() { return "sinfo.flood_duration.header.pdf.w_index"; } public static final String getHeaderBezeichnPdf() { return "sinfo.flood_duration.header.pdf.bezeichnung_index"; } public static final String getHeaderFloodDurPerYearPdf() { return "sinfo.flood_duration.header.pdf.fd_per_year_index"; } public static final String getHeaderWCsv() { return "sinfo.flood_duration.header.w_index"; } public static final String getHeaderBezeichnCsv() { return "sinfo.flood_duration.header.bezeichnung_index"; } public static final String getHeaderFloodDurPerYearCsv() { return "sinfo.flood_duration.header.fd_per_year_index"; } }