diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java @ 1100:29c67a76ad5d

Use new helper class FLYSUtils, minor refactorization. flys-artifacts/trunk@2603 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 29 Aug 2011 09:04:48 +0000
parents f465785ed1ae
children 82798c992975
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Mon Aug 29 09:01:40 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Mon Aug 29 09:04:48 2011 +0000
@@ -154,32 +154,19 @@
 
 
     /**
-     * Get the river.
-     * @todo resolve, this is a duplicate of WINFOArtifact.
-     */
-    public River getRiver() {
-        StateData dRiver = getData("river");
-
-        return dRiver != null
-            ? RiverFactory.getRiver((String) dRiver.getValue())
-            : null;
-    }
-
-
-    /**
      * Access the Gauge that the mainvalues are taken from.
      * @return Gauge that main values are taken from or null in case of
      *         invalid parameterization.
      */
     protected Gauge getGauge() {
-        River river = getRiver();
+        River river = FLYSUtils.getRiver(this);
 
         if (river == null) {
             return null;
         }
 
         double location = Double.parseDouble(
-                (String)getData("location").getValue());
+                getDataAsString("location"));
 
         return river.determineGaugeByPosition(location);
     }

http://dive4elements.wald.intevation.org