comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/ExtremeAccess.java @ 4825:f8217f1fef2e

ExtremeAccess, RangeAccess and callers: Refactored, moved getStep to RangeAccess. Inherit from RangeAccess, adjusted constructor and callers.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 21 Jan 2013 17:11:10 +0100
parents 2d3f8af87b7b
children
comparison
equal deleted inserted replaced
4824:d5d2faf14522 4825:f8217f1fef2e
1 package de.intevation.flys.artifacts.access; 1 package de.intevation.flys.artifacts.access;
2
3 import de.intevation.artifacts.CallContext;
2 4
3 import de.intevation.flys.artifacts.FLYSArtifact; 5 import de.intevation.flys.artifacts.FLYSArtifact;
4 6
5 import de.intevation.flys.artifacts.model.RangeWithValues; 7 import de.intevation.flys.artifacts.model.RangeWithValues;
6 8
11 13
12 import org.apache.log4j.Logger; 14 import org.apache.log4j.Logger;
13 15
14 /** Access data used for extreme value analysis. */ 16 /** Access data used for extreme value analysis. */
15 public class ExtremeAccess 17 public class ExtremeAccess
16 extends RiverAccess 18 extends RangeAccess
17 { 19 {
18 /** Our private logger. */ 20 /** Our private logger. */
19 private static Logger logger = Logger.getLogger(ExtremeAccess.class); 21 private static Logger logger = Logger.getLogger(ExtremeAccess.class);
20
21 protected Double from;
22 protected Double to;
23 protected Double step;
24 22
25 protected Long start; 23 protected Long start;
26 protected Long end; 24 protected Long end;
27 25
28 protected Double percent; 26 protected Double percent;
30 protected String function; 28 protected String function;
31 29
32 protected List<RangeWithValues> ranges; 30 protected List<RangeWithValues> ranges;
33 31
34 32
35 public ExtremeAccess() { 33 public ExtremeAccess(FLYSArtifact artifact, CallContext context) {
36 } 34 super(artifact, context);
37
38
39 public ExtremeAccess(FLYSArtifact artifact) {
40 super(artifact);
41 }
42
43
44 /** From (km) for calculation. */
45 public Double getFrom() {
46
47 if (from == null) {
48 from = getDouble("ld_from");
49 }
50
51 if (logger.isDebugEnabled()) {
52 logger.debug("from: '" + from + "'");
53 }
54
55 return from;
56 }
57
58
59 /** To (km) for calculation. */
60 public Double getTo() {
61
62 if (to == null) {
63 to = getDouble("ld_to");
64 }
65
66 if (logger.isDebugEnabled()) {
67 logger.debug("to: '" + to + "'");
68 }
69
70 return to;
71 }
72
73
74 /** Step width for calculation. */
75 public Double getStep() {
76
77 if (step == null) {
78 step = getDouble("ld_step");
79 }
80
81 if (logger.isDebugEnabled()) {
82 logger.debug("step: '" + step + "'");
83 }
84
85 return step;
86 } 35 }
87 36
88 37
89 /** Returns the percent given. */ 38 /** Returns the percent given. */
90 public Double getPercent() { 39 public Double getPercent() {

http://dive4elements.wald.intevation.org