9145
|
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
|
2 * Software engineering by |
|
3 * Björnsen Beratende Ingenieure GmbH |
|
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt |
|
5 * |
|
6 * This file is Free Software under the GNU AGPL (>=v3) |
|
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
|
8 * documentation coming with Dive4Elements River for details. |
|
9 */ |
|
10 package org.dive4elements.river.artifacts.sinfo.flood_duration; |
|
11 |
|
12 import java.io.Serializable; |
|
13 import java.text.NumberFormat; |
|
14 |
|
15 /** |
|
16 * @author Domenico Nardi Tironi |
|
17 * |
|
18 */ |
|
19 public class DurationWaterlevel implements Serializable { |
|
20 |
|
21 private static final long serialVersionUID = 1L; |
|
22 |
|
23 private final double w; |
|
24 private final double q; |
|
25 private final String bezeichnung; |
|
26 private final int floodDurDaysPerYear; |
|
27 |
|
28 public DurationWaterlevel(final double w, final int floodDurDaysPerYear, final double q, final String bezeichnung) { |
|
29 this.w = w; |
|
30 this.q = q; |
|
31 this.bezeichnung = bezeichnung; |
|
32 this.floodDurDaysPerYear = floodDurDaysPerYear; |
|
33 } |
|
34 |
|
35 public String getFloodDurDaysPerYearFormatted() { |
|
36 return String.valueOf(this.floodDurDaysPerYear); |
|
37 } |
|
38 |
|
39 public String getBezeichnung() { |
|
40 return this.bezeichnung; |
|
41 } |
|
42 |
|
43 public String getQFormatted(final NumberFormat qFormatter) { |
|
44 return qFormatter.format(this.q); |
|
45 } |
|
46 |
|
47 public String getWFormatted(final NumberFormat wFormatter) { |
|
48 return wFormatter.format(this.w); |
|
49 } |
|
50 |
|
51 public static final String getHeaderQ() { |
|
52 return "sinfo.flood_duration.header.q_index"; // kein extra-String für pdf |
|
53 } |
|
54 |
|
55 public static final String getHeaderW() { |
|
56 return "sinfo.flood_duration.header.pdf.w_index"; |
|
57 } |
|
58 |
|
59 public static final String getHeaderBezeichn() { |
|
60 return "sinfo.flood_duration.header.pdf.bezeichnung_index"; |
|
61 } |
|
62 |
|
63 public static final String getHeaderFloodDurPerYear() { |
|
64 return "sinfo.flood_duration.header.pdf.fd_per_year_index"; |
|
65 } |
|
66 } |