Mercurial > dive4elements > river
changeset 4824:d5d2faf14522
BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 21 Jan 2013 17:00:16 +0100 |
parents | dd146d5ee99f |
children | f8217f1fef2e |
files | flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/BedQualityAccess.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/RangeAccess.java |
diffstat | 2 files changed, 28 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/BedQualityAccess.java Mon Jan 21 16:19:20 2013 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/BedQualityAccess.java Mon Jan 21 17:00:16 2013 +0100 @@ -6,37 +6,24 @@ import org.apache.log4j.Logger; +import de.intevation.artifacts.CallContext; + import de.intevation.flys.artifacts.FLYSArtifact; import de.intevation.flys.artifacts.model.DateRange; -public class BedQualityAccess extends RiverAccess { +public class BedQualityAccess extends RangeAccess { private static final Logger logger = Logger .getLogger(BedQualityAccess.class); - private Double from; - private Double to; private List<String> bedDiameter; private List<String> bedloadDiameter; private List<DateRange> ranges; - public BedQualityAccess(FLYSArtifact artifact) { - super(artifact); - } - public double getFrom() { - if (from == null) { - from = getDouble("ld_from"); - } - return from.doubleValue(); - } - - public double getTo() { - if (to == null) { - to = getDouble("ld_to"); - } - return to.doubleValue(); + public BedQualityAccess(FLYSArtifact artifact, CallContext context) { + super(artifact, context); } public List<DateRange> getDateRanges() {
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/RangeAccess.java Mon Jan 21 16:19:20 2013 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/RangeAccess.java Mon Jan 21 17:00:16 2013 +0100 @@ -15,6 +15,10 @@ private CallContext context; + Double from; + + Double to; + public RangeAccess(FLYSArtifact artifact, CallContext context) { super(artifact); @@ -22,6 +26,25 @@ } + /** Return ld_from data. */ + public double getFrom() { + if (from == null) { + from = getDouble("ld_from"); + } + + return from.doubleValue(); + } + + + /** Return ld_to data. */ + public double getTo() { + if (to == null) { + to = getDouble("ld_to"); + } + return to.doubleValue(); + } + + /** * Get min and max kilometer, independent of parametization * (ld_from/to vs ld_locations).