annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/RangeAccess.java @ 4852:9790a284246c

RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 23 Jan 2013 12:27:00 +0100
parents c9a27912840d
children a0949259181e
rev   line source
4647
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.access;
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
2
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
3 import org.apache.log4j.Logger;
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
4
4850
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
5 import gnu.trove.TDoubleArrayList;
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
6
4647
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
7 import de.intevation.artifacts.CallContext;
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
8 import de.intevation.flys.artifacts.FLYSArtifact;
4850
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
9 import de.intevation.flys.artifacts.WINFOArtifact;
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
10
4647
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
11 import de.intevation.flys.utils.FLYSUtils;
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
12
4850
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
13
4647
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
14 /** For the moment, light-weight wrapper around FLYSUtils. */
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15 // TODO employ 'Caching' like other Accesses, remove usage of FLYSUtils.
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16 public class RangeAccess
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
17 extends RiverAccess
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
18 {
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
19 private static Logger logger = Logger.getLogger(RangeAccess.class);
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
20
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
21 private CallContext context;
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
22
4852
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
23 public static enum KM_MODE { RANGE, LOCATIONS, NONE };
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
24
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
25 double[] kmRange;
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
26
4824
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
27 Double from;
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
28
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
29 Double to;
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
30
4825
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
31 Double step;
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
32
4852
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
33 private KM_MODE mode;
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
34
4647
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
35
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
36 public RangeAccess(FLYSArtifact artifact, CallContext context) {
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
37 super(artifact);
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
38 this.context = context;
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
39 }
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
40
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
41
4852
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
42 /** Evaluate the ld_mode data of artifact. */
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
43 public KM_MODE getKmRangeMode() {
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
44 if (mode != null) {
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
45 return mode;
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
46 }
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
47 String modeData = getString("ld_mode");
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
48
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
49 if (modeData == null || modeData.length() == 0) {
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
50 mode = KM_MODE.NONE;
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
51 }
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
52 else if (modeData.equals("distance")) {
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
53 mode = KM_MODE.RANGE;
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
54 }
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
55 else if (modeData.equals("locations")) {
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
56 mode = KM_MODE.LOCATIONS;
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
57 }
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
58 else {
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
59 mode = KM_MODE.NONE;
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
60 }
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
61
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
62 return mode;
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
63 }
9790a284246c RangeAccess, FLYSUtils; Moved getKmRangeMode implementation to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4850
diff changeset
64
4850
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
65 /**
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
66 * Return sorted array of locations at which stuff was calculated
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
67 * (from ld_locations data), null if not parameterized this way.
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
68 */
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
69 public double[] getLocations() {
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
70 String locationStr = getString("ld_locations");
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
71
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
72 if (locationStr == null || locationStr.length() == 0) {
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
73 if (getArtifact() instanceof WINFOArtifact) {
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
74 WINFOArtifact winfo = (WINFOArtifact) getArtifact();
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
75 if (winfo.getReferenceStartKm() != null && winfo.getReferenceEndKms() != null) {
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
76 return new double[]
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
77 {
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
78 winfo.getReferenceStartKm().doubleValue(),
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
79 winfo.getReferenceEndKms()[0]
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
80 };
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
81 }
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
82 }
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
83 return null;
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
84 }
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
85
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
86 String[] tmp = locationStr.split(" ");
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
87 TDoubleArrayList locations = new TDoubleArrayList();
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
88
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
89 for (String l: tmp) {
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
90 try {
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
91 locations.add(Double.parseDouble(l));
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
92 }
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
93 catch (NumberFormatException nfe) {
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
94 logger.debug(nfe.getLocalizedMessage(), nfe);
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
95 }
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
96 }
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
97
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
98 locations.sort();
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
99
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
100 return locations.toNativeArray();
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
101 }
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
102
c9a27912840d RangeAccess: Add accidentally omitted implementation of getLocations from FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4827
diff changeset
103
4827
15e55fdbb402 RangeAccess: Doc and debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4825
diff changeset
104 /** Return ld_from data (in km). */
4824
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
105 public double getFrom() {
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
106 if (from == null) {
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
107 from = getDouble("ld_from");
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
108 }
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
109
4827
15e55fdbb402 RangeAccess: Doc and debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4825
diff changeset
110 if (logger.isDebugEnabled()) {
15e55fdbb402 RangeAccess: Doc and debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4825
diff changeset
111 logger.debug("from: '" + from + "'");
15e55fdbb402 RangeAccess: Doc and debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4825
diff changeset
112 }
15e55fdbb402 RangeAccess: Doc and debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4825
diff changeset
113
4824
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
114 return from.doubleValue();
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
115 }
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
116
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
117
4827
15e55fdbb402 RangeAccess: Doc and debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4825
diff changeset
118 /** Return ld_to data (in km). */
4824
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
119 public double getTo() {
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
120 if (to == null) {
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
121 to = getDouble("ld_to");
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
122 }
4827
15e55fdbb402 RangeAccess: Doc and debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4825
diff changeset
123
15e55fdbb402 RangeAccess: Doc and debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4825
diff changeset
124 if (logger.isDebugEnabled()) {
15e55fdbb402 RangeAccess: Doc and debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4825
diff changeset
125 logger.debug("to: '" + to + "'");
15e55fdbb402 RangeAccess: Doc and debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4825
diff changeset
126 }
15e55fdbb402 RangeAccess: Doc and debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4825
diff changeset
127
4824
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
128 return to.doubleValue();
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
129 }
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
130
d5d2faf14522 BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4699
diff changeset
131
4825
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
132 /** Step width for calculation. */
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
133 public Double getStep() {
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
134
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
135 if (step == null) {
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
136 step = getDouble("ld_step");
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
137 }
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
138
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
139 if (logger.isDebugEnabled()) {
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
140 logger.debug("step: '" + step + "'");
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
141 }
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
142
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
143 return step;
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
144 }
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
145
f8217f1fef2e ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4824
diff changeset
146
4647
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
147 /**
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
148 * Get min and max kilometer, independent of parametization
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
149 * (ld_from/to vs ld_locations).
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
150 */
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
151 public double[] getKmRange() {
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
152 return FLYSUtils.getKmRange(this.getArtifact());
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
153 }
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
154
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
155
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
156 public double[] getKmFromTo() {
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
157 return FLYSUtils.getKmFromTo(this.getArtifact());
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
158 }
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
159 }
1fea4243721c Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
160 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org