annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/FixationArtifactAccess.java @ 3400:2eea676ba48f

smaller bandwidth fixes. flys-artifacts/trunk@5041 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 18 Jul 2012 13:11:41 +0000
parents 4a70525c5b0d
children
rev   line source
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.access;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
3 import de.intevation.artifactdatabase.data.StateData;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
4 import de.intevation.flys.artifacts.FLYSArtifact;
3210
ae14f412ba10 SQ: finished the access stuff.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3209
diff changeset
5 import de.intevation.flys.artifacts.model.DateRange;
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
6
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
7 import java.util.Arrays;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
8 import java.util.Date;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
9
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10 import org.apache.log4j.Logger;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
11
3230
b888c5eb65b3 Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3211
diff changeset
12
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
13 public class FixationArtifactAccess
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
14 extends Access
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
15 {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
16 private static Logger log = Logger.getLogger(FixationArtifactAccess.class);
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
17
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
18 protected String river;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20 protected String calculationMode;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
21
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
22 protected Double from;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23 protected Double to;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
24 protected Double step;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
25
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26 protected Long start;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
27 protected Long end;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29 protected Integer qSectorStart;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30 protected Integer qSectorEnd;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32 protected DateRange referencePeriod;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33 protected DateRange [] analysisPeriods;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
34
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
35 protected int [] events;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
36
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
37 protected Boolean preprocessing;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
38
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
39 protected String function;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
40
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
41 protected double [] qs;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
42
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
43 public FixationArtifactAccess() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
44 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
45
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
46 public FixationArtifactAccess(FLYSArtifact artifact) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
47 super(artifact);
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
48 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
49
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
50 public String getRiver() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
51 if (river == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
52 river = getString("river");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
53 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
54 if (log.isDebugEnabled()) {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
55 log.debug("river: '" + river + "'");
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
56 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
57 return river;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
58 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
59
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
60 public String getCalculationMode() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
61 if (calculationMode == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
62 calculationMode = getString("calculation.mode");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
63 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
64
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
65 if (log.isDebugEnabled()) {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
66 log.debug("calculationMode: '" + calculationMode + "'");
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
67 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
68 return calculationMode;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
69 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
70
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
71 public Double getFrom() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
72
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
73 if (from == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
74 from = getDouble("from");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
75 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
76
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
77 if (log.isDebugEnabled()) {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
78 log.debug("from: '" + from + "'");
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
79 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
80
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
81 return from;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
82 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
83
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
84 public Double getTo() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
85
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
86 if (to == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
87 to = getDouble("to");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
88 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
89
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
90 if (log.isDebugEnabled()) {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
91 log.debug("to: '" + to + "'");
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
92 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
93
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
94 return to;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
95 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
96
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
97 public Double getStep() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
98
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
99 if (step == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
100 step = getDouble("step");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
101 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
102
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
103 if (log.isDebugEnabled()) {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
104 log.debug("step: '" + step + "'");
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
105 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
106
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
107 return step;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
108 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
109
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
110 public Long getStart() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
111
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
112 if (start == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
113 start = getLong("start");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
114 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
115
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
116 if (log.isDebugEnabled()) {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
117 log.debug("start: '" + start + "'");
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
118 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
119
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
120 return start;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
121 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
122
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
123 public Long getEnd() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
124
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
125 if (end == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
126 end = getLong("end");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
127 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
128
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
129 if (log.isDebugEnabled()) {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
130 log.debug("end: '" + end + "'");
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
131 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
132
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
133 return end;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
134 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
135
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
136 public Integer getQSectorStart() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
137
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
138 if (qSectorStart == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
139 qSectorStart = getInteger("q1");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
140 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
141
3209
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
142 if (log.isDebugEnabled()) {
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
143 log.debug("q1: '" + qSectorStart + "'");
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
144 }
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
145
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
146 return qSectorStart;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
147 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
148
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
149 public Integer getQSectorEnd() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
150
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
151 if (qSectorEnd == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
152 qSectorEnd = getInteger("q2");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
153 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
154
3209
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
155 if (log.isDebugEnabled()) {
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
156 log.debug("q2: '" + qSectorEnd + "'");
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
157 }
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
158
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
159 return qSectorEnd;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
160 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
161
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
162 public int [] getEvents() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
163 if (events == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
164 events = getIntArray("events");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
165 }
3209
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
166 if (log.isDebugEnabled() && events != null) {
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
167 log.debug("events: " + Arrays.toString(events));
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
168 }
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
169 return events;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
170 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
171
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
172 public DateRange getReferencePeriod() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
173 if (referencePeriod == null) {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
174 StateData refStart = artifact.getData("ref_start");
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
175 StateData refEnd = artifact.getData("ref_end");
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
176
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
177 if (refStart == null || refEnd == null) {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
178 log.warn("missing 'ref_start' or 'ref_start' value");
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
179 return null;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
180 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
181
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
182 try {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
183 long rs = Long.parseLong((String)refStart.getValue());
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
184 long re = Long.parseLong((String)refEnd .getValue());
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
185
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
186 if (rs > re) { long t = rs; rs = re; re = t; }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
187
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
188 Date from = new Date(rs);
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
189 Date to = new Date(re);
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
190 referencePeriod = new DateRange(from, to);
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
191 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
192 catch (NumberFormatException nfe) {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
193 log.warn("ref_start or ref_end is not an integer.");
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
194 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
195 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
196
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
197 return referencePeriod;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
198 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
199
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
200 public DateRange [] getAnalysisPeriods() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
201 if (analysisPeriods == null) {
3211
a1a434c163a4 FixA: Fixed parameter name
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3210
diff changeset
202 analysisPeriods = getDateRange("ana_data");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
203 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
204
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
205 return analysisPeriods;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
206 }
3280
4a70525c5b0d Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3279
diff changeset
207
3279
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
208 /**
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
209 * @return DateRange object ranging from eldest to youngest date
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
210 * of analysis and reference periods.
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
211 */
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
212 public DateRange getDateRange() {
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
213 DateRange refP = getReferencePeriod();
3280
4a70525c5b0d Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3279
diff changeset
214
3279
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
215 Date from = refP.getFrom();
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
216 Date to = refP.getTo();
3280
4a70525c5b0d Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3279
diff changeset
217
3279
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
218 DateRange[] rs = getAnalysisPeriods();
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
219 for(DateRange r : rs) {
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
220 if(r.getFrom().before(from)) {
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
221 from = r.getFrom();
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
222 }
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
223 if(r.getTo().after(to)) {
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
224 to = r.getTo();
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
225 }
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
226 }
3280
4a70525c5b0d Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3279
diff changeset
227
3279
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
228 return new DateRange(from, to);
5a7b4f890d53 Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents: 3230
diff changeset
229 }
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
230
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
231 public Boolean getPreprocessing() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
232 if (preprocessing == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
233 preprocessing = getBoolean("preprocessing");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
234 }
3209
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
235 if (log.isDebugEnabled()) {
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
236 log.debug("preprocessing: " + preprocessing);
03fc05655258 SQ: Added artifact access stub.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3208
diff changeset
237 }
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
238 return preprocessing;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
239 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
240
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
241 public String getFunction() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
242 if (function == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
243 function = getString("function");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
244 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
245 if (log.isDebugEnabled()) {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
246 log.debug("function: " + function);
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
247 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
248 return function;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
249 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
250
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
251 public double [] getQs() {
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
252 if (qs == null) {
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
253 qs = getDoubleArray("qs");
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
254 }
3207
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
255
babb0798d548 Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3206
diff changeset
256 if (log.isDebugEnabled() && qs != null) {
3203
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
257 log.debug("qs: " + Arrays.toString(qs));
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
258 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
259 return qs;
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
260 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
261 }
1b9f791937c3 Moved FixationArtifactAccess to new access package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
262 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org