Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/DurationWaterlevel.java @ 9630:8da911b5169c
3 Significant also for Q_1, Q_2...
author | dnt_bjoernsen <d.tironi@bjoernsen.de> |
---|---|
date | Mon, 14 Oct 2019 18:07:31 +0200 |
parents | 5ce50640688c |
children |
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 | |
9630
8da911b5169c
3 Significant also for Q_1, Q_2...
dnt_bjoernsen <d.tironi@bjoernsen.de>
parents:
9357
diff
changeset
|
15 import org.dive4elements.artifacts.CallContext; |
8da911b5169c
3 Significant also for Q_1, Q_2...
dnt_bjoernsen <d.tironi@bjoernsen.de>
parents:
9357
diff
changeset
|
16 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType; |
8da911b5169c
3 Significant also for Q_1, Q_2...
dnt_bjoernsen <d.tironi@bjoernsen.de>
parents:
9357
diff
changeset
|
17 |
9145 | 18 /** |
19 * @author Domenico Nardi Tironi | |
20 * | |
21 */ | |
22 public class DurationWaterlevel implements Serializable { | |
23 | |
24 private static final long serialVersionUID = 1L; | |
25 | |
26 private final double w; | |
27 private final double q; | |
28 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
|
29 private final double floodDurDaysPerYear; |
9145 | 30 |
9357
5ce50640688c
S-Info flood duration: fixed error report output name, changed duration from int to double, added formatter
mschaefer
parents:
9269
diff
changeset
|
31 public DurationWaterlevel(final double w, final double floodDurDaysPerYear, final double q, final String bezeichnung) { |
9145 | 32 this.w = w; |
33 this.q = q; | |
34 this.bezeichnung = bezeichnung; | |
35 this.floodDurDaysPerYear = floodDurDaysPerYear; | |
36 } | |
37 | |
9205
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
38 public double getWaterlevel() { |
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
39 return this.w; |
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
40 } |
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
41 |
9269
83ebeb620b5a
Station specific main value annotations in S-Info flood duration curve, corrected infrastructure flood duration calculation
mschaefer
parents:
9217
diff
changeset
|
42 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
|
43 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
|
44 } |
83ebeb620b5a
Station specific main value annotations in S-Info flood duration curve, corrected infrastructure flood duration calculation
mschaefer
parents:
9217
diff
changeset
|
45 |
9357
5ce50640688c
S-Info flood duration: fixed error report output name, changed duration from int to double, added formatter
mschaefer
parents:
9269
diff
changeset
|
46 public double getFloodDurDaysPerYear() { |
9205
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
47 return this.floodDurDaysPerYear; |
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
48 } |
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9145
diff
changeset
|
49 |
9357
5ce50640688c
S-Info flood duration: fixed error report output name, changed duration from int to double, added formatter
mschaefer
parents:
9269
diff
changeset
|
50 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
|
51 return durFormatter.format(this.floodDurDaysPerYear); |
9145 | 52 } |
53 | |
54 public String getBezeichnung() { | |
55 return this.bezeichnung; | |
56 } | |
57 | |
58 public String getQFormatted(final NumberFormat qFormatter) { | |
59 return qFormatter.format(this.q); | |
60 } | |
61 | |
9630
8da911b5169c
3 Significant also for Q_1, Q_2...
dnt_bjoernsen <d.tironi@bjoernsen.de>
parents:
9357
diff
changeset
|
62 public String getQFormatted3Significant(final CallContext context) { |
8da911b5169c
3 Significant also for Q_1, Q_2...
dnt_bjoernsen <d.tironi@bjoernsen.de>
parents:
9357
diff
changeset
|
63 return SInfoResultType.floodDischarge.exportValue(context, this.q); |
8da911b5169c
3 Significant also for Q_1, Q_2...
dnt_bjoernsen <d.tironi@bjoernsen.de>
parents:
9357
diff
changeset
|
64 } |
8da911b5169c
3 Significant also for Q_1, Q_2...
dnt_bjoernsen <d.tironi@bjoernsen.de>
parents:
9357
diff
changeset
|
65 |
9145 | 66 public String getWFormatted(final NumberFormat wFormatter) { |
67 return wFormatter.format(this.w); | |
68 } | |
69 | |
9217 | 70 // normally, the label is included in the type, but we need to replace the index ("_1") |
9145 | 71 public static final String getHeaderQ() { |
9217 | 72 return "sinfo.flood_duration.header.q_index"; |
9145 | 73 } |
74 | |
9217 | 75 public static final String getHeaderWPdf() { |
9145 | 76 return "sinfo.flood_duration.header.pdf.w_index"; |
77 } | |
78 | |
9217 | 79 public static final String getHeaderBezeichnPdf() { |
9145 | 80 return "sinfo.flood_duration.header.pdf.bezeichnung_index"; |
81 } | |
82 | |
9217 | 83 public static final String getHeaderFloodDurPerYearPdf() { |
9145 | 84 return "sinfo.flood_duration.header.pdf.fd_per_year_index"; |
85 } | |
9217 | 86 |
87 public static final String getHeaderWCsv() { | |
88 return "sinfo.flood_duration.header.w_index"; | |
89 } | |
90 | |
91 public static final String getHeaderBezeichnCsv() { | |
92 return "sinfo.flood_duration.header.bezeichnung_index"; | |
93 } | |
94 | |
95 public static final String getHeaderFloodDurPerYearCsv() { | |
96 return "sinfo.flood_duration.header.fd_per_year_index"; | |
97 } | |
98 | |
9145 | 99 } |