Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/RangeAccess.java @ 4647:1fea4243721c
Add stubs for GaugeAccess and RangeAccess, for they do not get lost.
These cannot be used as is, but is a starting stone for proper implementation
and refactoring.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 05 Dec 2012 13:57:50 +0100 |
parents | |
children | 756aba0d2a7a |
comparison
equal
deleted
inserted
replaced
4646:d70284c92728 | 4647:1fea4243721c |
---|---|
1 package de.intevation.flys.artifacts.access; | |
2 | |
3 import java.util.Arrays; | |
4 | |
5 import org.apache.log4j.Logger; | |
6 | |
7 import de.intevation.artifacts.CallContext; | |
8 import de.intevation.flys.artifacts.FLYSArtifact; | |
9 import de.intevation.flys.utils.FLYSUtils; | |
10 import de.intevation.flys.utils.StringUtil; | |
11 | |
12 /** For the moment, light-weight wrapper around FLYSUtils. */ | |
13 // TODO employ 'Caching' like other Accesses, remove usage of FLYSUtils. | |
14 public class RangeAccess | |
15 extends RiverAccess | |
16 { | |
17 private static Logger logger = Logger.getLogger(RangeAccess.class); | |
18 | |
19 private CallContext context; | |
20 | |
21 | |
22 public RangeAccess(FLYSArtifact artifact, CallContext context) { | |
23 super(artifact); | |
24 this.context = context; | |
25 } | |
26 | |
27 | |
28 /** | |
29 * Get min and max kilometer, independent of parametization | |
30 * (ld_from/to vs ld_locations). | |
31 */ | |
32 public double[] getKmRange() { | |
33 return FLYSUtils.getKmRange(this.getArtifact()); | |
34 } | |
35 | |
36 | |
37 public double[] getKmFromTo() { | |
38 return FLYSUtils.getKmFromTo(this.getArtifact()); | |
39 } | |
40 | |
41 | |
42 /** | |
43 * Return sorted array of locations at which stuff was calculated | |
44 * (from ld_locations data), null if not parameterized this way. | |
45 */ | |
46 public double[] getLocations() { | |
47 return FLYSUtils.getLocations(this.getArtifact()); | |
48 } | |
49 } | |
50 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |