changeset 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 af73f196eccc
children 82798c992975
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java
diffstat 2 files changed, 9 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Aug 29 09:01:40 2011 +0000
+++ b/flys-artifacts/ChangeLog	Mon Aug 29 09:04:48 2011 +0000
@@ -1,3 +1,10 @@
+2011-08-29  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	Use new helper class FLYSUtils, minor refactorization.
+
+	* src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java:
+	  Use new functionality of helper class, convenience of FLYSArtifact.
+
 2011-08-29  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	Refactored to use new Helper class FLYSUtils, moved getRiver-functionality
--- 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