Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/access/HistoricalDischargeAccess.java @ 7357:9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Idea is that Artifact and Access are lightweight. Access access the 'data'
('parameterization') attached to artifact, not the data delivered by means of
artifact and its parameterization.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 16 Oct 2013 10:42:45 +0200 |
parents | af13ceeba52a |
children |
rev | line source |
---|---|
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5914
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5914
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4736
diff
changeset
|
9 package org.dive4elements.river.artifacts.access; |
4152
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import java.util.Date; |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
13 import org.dive4elements.river.artifacts.D4EArtifact; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4736
diff
changeset
|
14 import org.dive4elements.river.artifacts.model.Timerange; |
4152
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 public class HistoricalDischargeAccess extends RiverAccess { |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4152
diff
changeset
|
19 public static enum EvaluationMode { |
5914
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
20 W(0), Q(1); |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
21 |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
22 private final int mode; |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
23 |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
24 EvaluationMode(int mode) { |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
25 this.mode = mode; |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
26 } |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
27 |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
28 public int getMode() { |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
29 return mode; |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
30 } |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4152
diff
changeset
|
31 } |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4152
diff
changeset
|
32 |
4152
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 public static final String DATA_EVALUATION_TIME = "year_range"; |
4233
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
34 public static final String DATA_EVALUATION_MODE = "historical_mode"; |
5914
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
35 public static final String DATA_INPUT_VALUES = "historical_values"; |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
36 public static final String DATA_REFERENCE_GAUGE = "reference_gauge"; |
4152
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 private Timerange evaluationTimerange; |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4152
diff
changeset
|
39 private EvaluationMode evaluationMode; |
4152
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 |
4233
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
41 private double[] qs; |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
42 private double[] ws; |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
43 |
5914
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
44 private Long officialGaugeNumber; |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
45 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
46 public HistoricalDischargeAccess(D4EArtifact artifact) { |
4152
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 super(artifact); |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 } |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
4233
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
50 /** |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
51 * This method returns the evaluation mode. The evaluation mode W is set, if |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
52 * the <b>DATA_EVALUATION_MODE</b> is 0. Otherwise, the evaluation mode Q is |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
53 * set. |
4736
b195fede1c3b
Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4233
diff
changeset
|
54 * |
4233
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
55 * @return EvaluationMode.W if the parameter <i>historical_mode</i> is set |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
56 * to 0, otherwise EvaluationMode.Q. |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
57 */ |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4152
diff
changeset
|
58 public EvaluationMode getEvaluationMode() { |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4152
diff
changeset
|
59 if (evaluationMode == null) { |
4233
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
60 int mode = getInteger(DATA_EVALUATION_MODE); |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4152
diff
changeset
|
61 evaluationMode = mode == 0 ? EvaluationMode.W : EvaluationMode.Q; |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4152
diff
changeset
|
62 } |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4152
diff
changeset
|
63 |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4152
diff
changeset
|
64 return evaluationMode; |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4152
diff
changeset
|
65 } |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4152
diff
changeset
|
66 |
5914
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
67 |
4233
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
68 /** |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
69 * This method returns the time range specified by <i>year_range</i> |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
70 * parameter. This parameter has to be a string that consists of two long |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
71 * values (time millis since 1970) separated by a ';'. |
4736
b195fede1c3b
Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4233
diff
changeset
|
72 * |
4233
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
73 * @return the evaluation time range specified by <i>year_range</i>. |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
74 */ |
4152
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 public Timerange getEvaluationTimerange() { |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 if (evaluationTimerange == null) { |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 long[] startend = getLongArray(DATA_EVALUATION_TIME); |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 if (startend != null && startend.length > 1) { |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 Date start = new Date(startend[0]); |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 Date end = new Date(startend[1]); |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 evaluationTimerange = new Timerange(start, end); |
5914
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
84 evaluationTimerange.sort(); |
4152
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 } |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 } |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 return evaluationTimerange; |
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 } |
4233
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
90 |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
91 /** |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
92 * This method returns the input Q values if the evaluation mode Q is set. |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
93 * Otherwise, this method will return a double array of length 0. The values |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
94 * returned by this method are extracted from string parameter |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
95 * <i>historical_values</i>. |
4736
b195fede1c3b
Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4233
diff
changeset
|
96 * |
4233
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
97 * @return the input Q values or a double array of length 0. |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
98 */ |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
99 public double[] getQs() { |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
100 if (qs == null) { |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
101 if (getEvaluationMode() == EvaluationMode.Q) { |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
102 qs = getDoubleArray(DATA_INPUT_VALUES); |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
103 } |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
104 else { |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
105 qs = new double[0]; |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
106 } |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
107 } |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
108 |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
109 return qs; |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
110 } |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
111 |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
112 /** |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
113 * This method returns the input W values if the evaluation mode W is set. |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
114 * Otherwise, this method will return a double array of length 0. The values |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
115 * returned by this method are extracted from string parameter |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
116 * <i>historical_values</i>. |
4736
b195fede1c3b
Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4233
diff
changeset
|
117 * |
4233
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
118 * @return the input W values or a double array of length 0. |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
119 */ |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
120 public double[] getWs() { |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
121 if (ws == null) { |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
122 if (getEvaluationMode() == EvaluationMode.W) { |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
123 ws = getDoubleArray(DATA_INPUT_VALUES); |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
124 } |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
125 else { |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
126 ws = new double[0]; |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
127 } |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
128 } |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
129 |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
130 return ws; |
d952372e7083
Added getQs() and getWs() to HistoricalDischargeAccess class and added some Javadoc to its methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4232
diff
changeset
|
131 } |
5914
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
132 |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
133 public Long getOfficialGaugeNumber() { |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
134 if (officialGaugeNumber == null) { |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
135 officialGaugeNumber = getLong(DATA_REFERENCE_GAUGE); |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
136 } |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
137 return officialGaugeNumber; |
1058b3436dad
D4E river artifacts: Removed historical discharge calculation from WINFO artifact and use access instead.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
138 } |
4152
5ff3b2f5fb1c
Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 } |