Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/DurationWaterlevel.java @ 9596:fbfd66e8fb81
Softwaretests...20181219 6.2.2: Sinfo/Ued Haupt-/Extremwerte update for current km, W/Q of selected WSPL initially visible
author | mschaefer |
---|---|
date | Tue, 05 Feb 2019 15:43:27 +0100 |
parents | 5ce50640688c |
children | 8da911b5169c |
rev | line source |
---|---|
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; | |
9357
5ce50640688c
S-Info flood duration: fixed error report output name, changed duration from int to double, added formatter
mschaefer
parents:
9269
diff
changeset
|
26 private final double floodDurDaysPerYear; |
9145 | 27 |
9357
5ce50640688c
S-Info flood duration: fixed error report output name, changed duration from int to double, added formatter
mschaefer
parents:
9269
diff
changeset
|
28 public DurationWaterlevel(final double w, final double floodDurDaysPerYear, final double q, final String bezeichnung) { |
9145 | 29 this.w = w; |
30 this.q = q; | |
31 this.bezeichnung = bezeichnung; | |
32 this.floodDurDaysPerYear = floodDurDaysPerYear; | |
33 } | |
34 | |
9205
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
35 public double getWaterlevel() { |
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
36 return this.w; |
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
37 } |
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
38 |
9269
83ebeb620b5a
Station specific main value annotations in S-Info flood duration curve, corrected infrastructure flood duration calculation
mschaefer
parents:
9217
diff
changeset
|
39 public double getDischarge() { |
83ebeb620b5a
Station specific main value annotations in S-Info flood duration curve, corrected infrastructure flood duration calculation
mschaefer
parents:
9217
diff
changeset
|
40 return this.q; |
83ebeb620b5a
Station specific main value annotations in S-Info flood duration curve, corrected infrastructure flood duration calculation
mschaefer
parents:
9217
diff
changeset
|
41 } |
83ebeb620b5a
Station specific main value annotations in S-Info flood duration curve, corrected infrastructure flood duration calculation
mschaefer
parents:
9217
diff
changeset
|
42 |
9357
5ce50640688c
S-Info flood duration: fixed error report output name, changed duration from int to double, added formatter
mschaefer
parents:
9269
diff
changeset
|
43 public double getFloodDurDaysPerYear() { |
9205
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
44 return this.floodDurDaysPerYear; |
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
45 } |
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
46 |
9357
5ce50640688c
S-Info flood duration: fixed error report output name, changed duration from int to double, added formatter
mschaefer
parents:
9269
diff
changeset
|
47 public String getFloodDurDaysPerYearFormatted(final NumberFormat durFormatter) { |
5ce50640688c
S-Info flood duration: fixed error report output name, changed duration from int to double, added formatter
mschaefer
parents:
9269
diff
changeset
|
48 return durFormatter.format(this.floodDurDaysPerYear); |
9145 | 49 } |
50 | |
51 public String getBezeichnung() { | |
52 return this.bezeichnung; | |
53 } | |
54 | |
55 public String getQFormatted(final NumberFormat qFormatter) { | |
56 return qFormatter.format(this.q); | |
57 } | |
58 | |
59 public String getWFormatted(final NumberFormat wFormatter) { | |
60 return wFormatter.format(this.w); | |
61 } | |
62 | |
9217 | 63 // normally, the label is included in the type, but we need to replace the index ("_1") |
9145 | 64 public static final String getHeaderQ() { |
9217 | 65 return "sinfo.flood_duration.header.q_index"; |
9145 | 66 } |
67 | |
9217 | 68 public static final String getHeaderWPdf() { |
9145 | 69 return "sinfo.flood_duration.header.pdf.w_index"; |
70 } | |
71 | |
9217 | 72 public static final String getHeaderBezeichnPdf() { |
9145 | 73 return "sinfo.flood_duration.header.pdf.bezeichnung_index"; |
74 } | |
75 | |
9217 | 76 public static final String getHeaderFloodDurPerYearPdf() { |
9145 | 77 return "sinfo.flood_duration.header.pdf.fd_per_year_index"; |
78 } | |
9217 | 79 |
80 public static final String getHeaderWCsv() { | |
81 return "sinfo.flood_duration.header.w_index"; | |
82 } | |
83 | |
84 public static final String getHeaderBezeichnCsv() { | |
85 return "sinfo.flood_duration.header.bezeichnung_index"; | |
86 } | |
87 | |
88 public static final String getHeaderFloodDurPerYearCsv() { | |
89 return "sinfo.flood_duration.header.fd_per_year_index"; | |
90 } | |
91 | |
9145 | 92 } |