comparison 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
comparison
equal deleted inserted replaced
4851:a1ce76091ade 4852:9790a284246c
18 { 18 {
19 private static Logger logger = Logger.getLogger(RangeAccess.class); 19 private static Logger logger = Logger.getLogger(RangeAccess.class);
20 20
21 private CallContext context; 21 private CallContext context;
22 22
23 public static enum KM_MODE { RANGE, LOCATIONS, NONE };
24
25 double[] kmRange;
26
23 Double from; 27 Double from;
24 28
25 Double to; 29 Double to;
26 30
27 Double step; 31 Double step;
32
33 private KM_MODE mode;
28 34
29 35
30 public RangeAccess(FLYSArtifact artifact, CallContext context) { 36 public RangeAccess(FLYSArtifact artifact, CallContext context) {
31 super(artifact); 37 super(artifact);
32 this.context = context; 38 this.context = context;
33 } 39 }
34 40
41
42 /** Evaluate the ld_mode data of artifact. */
43 public KM_MODE getKmRangeMode() {
44 if (mode != null) {
45 return mode;
46 }
47 String modeData = getString("ld_mode");
48
49 if (modeData == null || modeData.length() == 0) {
50 mode = KM_MODE.NONE;
51 }
52 else if (modeData.equals("distance")) {
53 mode = KM_MODE.RANGE;
54 }
55 else if (modeData.equals("locations")) {
56 mode = KM_MODE.LOCATIONS;
57 }
58 else {
59 mode = KM_MODE.NONE;
60 }
61
62 return mode;
63 }
35 64
36 /** 65 /**
37 * Return sorted array of locations at which stuff was calculated 66 * Return sorted array of locations at which stuff was calculated
38 * (from ld_locations data), null if not parameterized this way. 67 * (from ld_locations data), null if not parameterized this way.
39 */ 68 */

http://dive4elements.wald.intevation.org