diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation4.java @ 709:3b7e9ddf6bb1

New model to transport data and error reports of calculations. flys-artifacts/trunk@2165 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 20 Jun 2011 12:32:32 +0000
parents eab5e5089d77
children 08a3c3651e36
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation4.java	Sat Jun 18 20:20:34 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation4.java	Mon Jun 20 12:32:32 2011 +0000
@@ -84,7 +84,7 @@
         Collections.sort(segments, REF_CMP);
     }
 
-    public WQKms [] calculate(
+    public CalculationResult calculate(
         WstValueTable table,
         double from, double to, double step
     ) {
@@ -103,7 +103,7 @@
             logger.debug("no segments found");
             // TODO: I18N
             addProblem("no segments found");
-            return new WQKms[0];
+            return new CalculationResult(new WQKms[0], this);
         }
 
         int numResults = segments.get(0).values.length;
@@ -112,7 +112,7 @@
             logger.debug("no values given");
             // TODO: I18N
             addProblem("no values given");
-            return new WQKms[0];
+            return new CalculationResult(new WQKms[0], this);
         }
 
 
@@ -278,7 +278,7 @@
             results[i].setName(createName(i));
         }
 
-        return results;
+        return new CalculationResult(results, this);
     }
 
     protected String createName(int index) {

http://dive4elements.wald.intevation.org