changeset 3415:e3c7a3228bc2

FixA: Renamed FixResult to FixAnalysisResult. flys-artifacts/trunk@5068 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 19 Jul 2012 15:16:48 +0000
parents 1bb6fb621167
children f14206b4b688
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisEventsFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisPeriodsFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisResult.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAvSectorFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixDerivateFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixDeviationFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixLongitudinalAnalysisFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixLongitudinalDeviationFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixLongitudinalReferenceFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixOutlierFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixReferenceEventsFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixResult.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixWQCurveFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixAnalysisCompute.java flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/DeltaWtExporter.java flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/ParametersExporter.java
diffstat 18 files changed, 127 insertions(+), 101 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/ChangeLog	Thu Jul 19 15:16:48 2012 +0000
@@ -1,3 +1,28 @@
+2012-07-19	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/fixings/FixResult.java:
+	  Removed.
+
+	* src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisResult.java:
+	  Re-added here.
+
+	* src/main/java/de/intevation/flys/artifacts/model/fixings/FixAvSectorFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixLongitudinalDeviationFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixWQCurveFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixLongitudinalAnalysisFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixDerivateFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixLongitudinalReferenceFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisEventsFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisPeriodsFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixDeviationFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixOutlierFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/model/fixings/FixReferenceEventsFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/FixAnalysisCompute.java,
+	  src/main/java/de/intevation/flys/exports/fixings/ParametersExporter.java,
+	  src/main/java/de/intevation/flys/exports/fixings/DeltaWtExporter.java:
+	  Adjusted.
+
 2012-07-19	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingCalculation.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java	Thu Jul 19 15:16:48 2012 +0000
@@ -270,7 +270,7 @@
         referenced.sort();
         analysisPeriods.sort();
 
-        FixResult fr = new FixResult(
+        FixAnalysisResult fr = new FixAnalysisResult(
             results,
             referenced, outliers,
             analysisPeriods);
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisEventsFacet.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisEventsFacet.java	Thu Jul 19 15:16:48 2012 +0000
@@ -68,7 +68,7 @@
                                                  ComputeType.ADVANCE,
                                                  false);
 
-            FixResult result = (FixResult) res.getData();
+            FixAnalysisResult result = (FixAnalysisResult) res.getData();
             double currentKm =
                 ((Double)context.getContextValue("currentKm")).doubleValue();
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisPeriodsFacet.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisPeriodsFacet.java	Thu Jul 19 15:16:48 2012 +0000
@@ -69,7 +69,7 @@
                                                  ComputeType.ADVANCE,
                                                  false);
 
-            FixResult result = (FixResult) res.getData();
+            FixAnalysisResult result = (FixAnalysisResult) res.getData();
             double currentKm =
                 ((Double)context.getContextValue("currentKm")).doubleValue();
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisResult.java	Thu Jul 19 15:16:48 2012 +0000
@@ -0,0 +1,79 @@
+package de.intevation.flys.artifacts.model.fixings;
+
+import de.intevation.flys.artifacts.model.Parameters;
+
+import de.intevation.flys.utils.KMIndex;
+
+import java.io.Serializable;
+
+public class FixAnalysisResult
+implements   Serializable
+{
+    protected Parameters                 parameters;
+    protected KMIndex<QWD []>            referenced;
+    protected KMIndex<QW []>             outliers;
+    protected KMIndex<AnalysisPeriod []> analysisPeriods;
+
+    public FixAnalysisResult() {
+    }
+
+    public FixAnalysisResult(
+        Parameters                 parameters,
+        KMIndex<QWD []>            referenced,
+        KMIndex<QW []>             outliers,
+        KMIndex<AnalysisPeriod []> analysisPeriods
+    ) {
+        this.parameters      = parameters;
+        this.referenced      = referenced;
+        this.outliers        = outliers;
+        this.analysisPeriods = analysisPeriods;
+    }
+
+    public int getUsedSectorsInAnalysisPeriods() {
+        int result = 0;
+        for (KMIndex.Entry<AnalysisPeriod []> entry: analysisPeriods) {
+            for (AnalysisPeriod period: entry.getValue()) {
+                for (int i = 0; i < 4; ++i) {
+                    result |= period.getQSectorAverage(i) != null
+                        ? (1 << i)
+                        : 0;
+                }
+                // XXX: Stop early on result == ~(~0 << 4)) ?
+            }
+        }
+        return result;
+    }
+
+    public Parameters getParameters() {
+        return parameters;
+    }
+
+    public void setParameters(Parameters parameters) {
+        this.parameters = parameters;
+    }
+
+    public KMIndex<AnalysisPeriod []> getAnalysisPeriods() {
+        return analysisPeriods;
+    }
+
+    public void setAnalysisPeriods(KMIndex<AnalysisPeriod []> analysisPeriods) {
+        this.analysisPeriods = analysisPeriods;
+    }
+
+    public KMIndex<QWD []> getReferenced() {
+        return referenced;
+    }
+
+    public void setReferenced(KMIndex<QWD []> referenced) {
+        this.referenced = referenced;
+    }
+
+    public KMIndex<QW []> getOutliers() {
+        return outliers;
+    }
+
+    public void setOutliers(KMIndex<QW []> outliers) {
+        this.outliers = outliers;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAvSectorFacet.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAvSectorFacet.java	Thu Jul 19 15:16:48 2012 +0000
@@ -67,7 +67,7 @@
                                                  ComputeType.ADVANCE,
                                                  false);
 
-            FixResult result = (FixResult) res.getData();
+            FixAnalysisResult result = (FixAnalysisResult) res.getData();
 
             double currentKm =
                 ((Double)context.getContextValue("currentKm")).doubleValue();
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixDerivateFacet.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixDerivateFacet.java	Thu Jul 19 15:16:48 2012 +0000
@@ -75,7 +75,7 @@
                                              ComputeType.ADVANCE,
                                              false);
 
-        FixResult result = (FixResult) res.getData();
+        FixAnalysisResult result = (FixAnalysisResult) res.getData();
         double currentKm =
             ((Double)context.getContextValue("currentKm")).doubleValue();
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixDeviationFacet.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixDeviationFacet.java	Thu Jul 19 15:16:48 2012 +0000
@@ -28,6 +28,7 @@
     /** House logger. */
     private static Logger logger = Logger.getLogger(FixDeviationFacet.class);
 
+    public static final String [] STD_DEV_COLUMN = { "std-dev" };
 
     /** Trivial Constructor. */
     public FixDeviationFacet() {
@@ -66,16 +67,16 @@
                                                  ComputeType.ADVANCE,
                                                  false);
 
-            FixResult result = (FixResult) res.getData();
+            FixAnalysisResult result = (FixAnalysisResult) res.getData();
             double currentKm =
                 ((Double)context.getContextValue("currentKm")).doubleValue();
 
             Parameters params = result.getParameters();
 
             double[] stdDev =
-                params.interpolate("km", currentKm, new String[] {"std-dev"});
+                params.interpolate("km", currentKm, STD_DEV_COLUMN);
 
-            if(stdDev == null) {
+            if (stdDev == null) {
                 logger.warn("getData: stdDev == null at km " + currentKm);
                 return null;
             }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixLongitudinalAnalysisFacet.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixLongitudinalAnalysisFacet.java	Thu Jul 19 15:16:48 2012 +0000
@@ -70,7 +70,7 @@
                                                  ComputeType.ADVANCE,
                                                  false);
 
-            FixResult result = (FixResult) res.getData();
+            FixAnalysisResult result = (FixAnalysisResult) res.getData();
 
             KMIndex<AnalysisPeriod []> kmPeriods = result.getAnalysisPeriods();
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixLongitudinalDeviationFacet.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixLongitudinalDeviationFacet.java	Thu Jul 19 15:16:48 2012 +0000
@@ -71,7 +71,7 @@
                                                  ComputeType.ADVANCE,
                                                  false);
 
-            FixResult result = (FixResult) res.getData();
+            FixAnalysisResult result = (FixAnalysisResult) res.getData();
 
             KMIndex<AnalysisPeriod []> kmPeriods = result.getAnalysisPeriods();
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixLongitudinalReferenceFacet.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixLongitudinalReferenceFacet.java	Thu Jul 19 15:16:48 2012 +0000
@@ -71,7 +71,7 @@
                                                  ComputeType.ADVANCE,
                                                  false);
 
-            FixResult result = (FixResult) res.getData();
+            FixAnalysisResult result = (FixAnalysisResult) res.getData();
 
             KMIndex<QWD []> kmReference = result.getReferenced();
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixOutlierFacet.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixOutlierFacet.java	Thu Jul 19 15:16:48 2012 +0000
@@ -67,7 +67,7 @@
                                                  ComputeType.ADVANCE,
                                                  false);
 
-            FixResult result = (FixResult) res.getData();
+            FixAnalysisResult result = (FixAnalysisResult) res.getData();
             double currentKm =
                 ((Double)context.getContextValue("currentKm")).doubleValue();
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixReferenceEventsFacet.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixReferenceEventsFacet.java	Thu Jul 19 15:16:48 2012 +0000
@@ -69,7 +69,7 @@
                                                  ComputeType.ADVANCE,
                                                  false);
 
-            FixResult result = (FixResult) res.getData();
+            FixAnalysisResult result = (FixAnalysisResult) res.getData();
             double currentKm =
                 ((Double)context.getContextValue("currentKm")).doubleValue();
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixResult.java	Thu Jul 19 14:59:16 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-package de.intevation.flys.artifacts.model.fixings;
-
-import de.intevation.flys.artifacts.model.Parameters;
-
-import de.intevation.flys.utils.KMIndex;
-
-import java.io.Serializable;
-
-public class FixResult
-implements   Serializable
-{
-    protected Parameters                 parameters;
-    protected KMIndex<QWD []>            referenced;
-    protected KMIndex<QW []>             outliers;
-    protected KMIndex<AnalysisPeriod []> analysisPeriods;
-
-    public FixResult() {
-    }
-
-    public FixResult(
-        Parameters                 parameters,
-        KMIndex<QWD []>            referenced,
-        KMIndex<QW []>             outliers,
-        KMIndex<AnalysisPeriod []> analysisPeriods
-    ) {
-        this.parameters      = parameters;
-        this.referenced      = referenced;
-        this.outliers        = outliers;
-        this.analysisPeriods = analysisPeriods;
-    }
-
-    public int getUsedSectorsInAnalysisPeriods() {
-        int result = 0;
-        for (KMIndex.Entry<AnalysisPeriod []> entry: analysisPeriods) {
-            for (AnalysisPeriod period: entry.getValue()) {
-                for (int i = 0; i < 4; ++i) {
-                    result |= period.getQSectorAverage(i) != null
-                        ? (1 << i)
-                        : 0;
-                }
-                // XXX: Stop early on result == ~(~0 << 4)) ?
-            }
-        }
-        return result;
-    }
-
-    public Parameters getParameters() {
-        return parameters;
-    }
-
-    public void setParameters(Parameters parameters) {
-        this.parameters = parameters;
-    }
-
-    public KMIndex<AnalysisPeriod []> getAnalysisPeriods() {
-        return analysisPeriods;
-    }
-
-    public void setAnalysisPeriods(KMIndex<AnalysisPeriod []> analysisPeriods) {
-        this.analysisPeriods = analysisPeriods;
-    }
-
-    public KMIndex<QWD []> getReferenced() {
-        return referenced;
-    }
-
-    public void setReferenced(KMIndex<QWD []> referenced) {
-        this.referenced = referenced;
-    }
-
-    public KMIndex<QW []> getOutliers() {
-        return outliers;
-    }
-
-    public void setOutliers(KMIndex<QW []> outliers) {
-        this.outliers = outliers;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixWQCurveFacet.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixWQCurveFacet.java	Thu Jul 19 15:16:48 2012 +0000
@@ -68,7 +68,7 @@
                                                  ComputeType.ADVANCE,
                                                  false);
 
-            FixResult result = (FixResult) res.getData();
+            FixAnalysisResult result = (FixAnalysisResult) res.getData();
             double currentKm =
                 ((Double)context.getContextValue("currentKm")).doubleValue();
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixAnalysisCompute.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixAnalysisCompute.java	Thu Jul 19 15:16:48 2012 +0000
@@ -25,7 +25,7 @@
 import de.intevation.flys.artifacts.model.fixings.FixLongitudinalReferenceFacet;
 import de.intevation.flys.artifacts.model.fixings.FixOutlierFacet;
 import de.intevation.flys.artifacts.model.fixings.FixReferenceEventsFacet;
-import de.intevation.flys.artifacts.model.fixings.FixResult;
+import de.intevation.flys.artifacts.model.fixings.FixAnalysisResult;
 import de.intevation.flys.artifacts.model.fixings.FixWQCurveFacet;
 
 import de.intevation.flys.artifacts.resources.Resources;
@@ -108,7 +108,7 @@
             facets.add(new ReportFacet(ComputeType.ADVANCE, hash, id));
         }
 
-        FixResult fr = (FixResult)res.getData();
+        FixAnalysisResult fr = (FixAnalysisResult)res.getData();
 
         if (fr == null) {
             return res;
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/DeltaWtExporter.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/DeltaWtExporter.java	Thu Jul 19 15:16:48 2012 +0000
@@ -8,7 +8,7 @@
 import de.intevation.flys.artifacts.model.CalculationResult;
 
 import de.intevation.flys.artifacts.model.fixings.AnalysisPeriod;
-import de.intevation.flys.artifacts.model.fixings.FixResult;
+import de.intevation.flys.artifacts.model.fixings.FixAnalysisResult;
 import de.intevation.flys.artifacts.model.fixings.QWD;
 
 import de.intevation.flys.artifacts.resources.Resources;
@@ -107,10 +107,10 @@
         }
 
         Object data = ((CalculationResult)d).getData();
-        if (!(data instanceof FixResult)) {
+        if (!(data instanceof FixAnalysisResult)) {
             log.warn("Invalid data stored in result.");
         }
-        FixResult result = (FixResult)data;
+        FixAnalysisResult result = (FixAnalysisResult)data;
         analysisPeriods.add(result.getAnalysisPeriods());
         referenceEvents.add(result.getReferenced());
     }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/ParametersExporter.java	Thu Jul 19 14:59:16 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/ParametersExporter.java	Thu Jul 19 15:16:48 2012 +0000
@@ -7,7 +7,7 @@
 import de.intevation.flys.artifacts.model.CalculationResult;
 import de.intevation.flys.artifacts.model.Parameters;
 
-import de.intevation.flys.artifacts.model.fixings.FixResult;
+import de.intevation.flys.artifacts.model.fixings.FixAnalysisResult;
 
 import de.intevation.flys.artifacts.resources.Resources;
 
@@ -48,10 +48,10 @@
         }
 
         Object data = ((CalculationResult)d).getData();
-        if (!(data instanceof FixResult)) {
+        if (!(data instanceof FixAnalysisResult)) {
             log.warn("Invalid data stored in result.");
         }
-        FixResult result = (FixResult)data;
+        FixAnalysisResult result = (FixAnalysisResult)data;
         parametersList.add(result.getParameters());
     }
 

http://dive4elements.wald.intevation.org