[Dive4elements-commits] [PATCH 1 of 3] BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess

Wald Commits scm-commit at wald.intevation.org
Mon Jan 21 17:20:17 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1358784016 -3600
# Node ID d5d2faf14522560781d3bcc74d63ddd054503b31
# Parent  dd146d5ee99f57b5b340381e2ee606d2053b5659
BedHeightQualityAccess, RangeAccess: Refactored, moved getFrom/To to RangeAccess.

diff -r dd146d5ee99f -r d5d2faf14522 flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/BedQualityAccess.java
--- 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() {
diff -r dd146d5ee99f -r d5d2faf14522 flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/RangeAccess.java
--- 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).


More information about the Dive4elements-commits mailing list