diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java @ 3003:e5e6363e6cba

FixA: Explicit model for date ranges. flys-artifacts/trunk@4559 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 30 May 2012 14:45:36 +0000
parents a2b265b9b2f7
children 9e0500d64524
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java	Wed May 30 13:46:13 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java	Wed May 30 14:45:36 2012 +0000
@@ -24,7 +24,6 @@
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Date;
 
 import org.apache.commons.math.MathException;
 
@@ -39,31 +38,31 @@
 {
     private static Logger log = Logger.getLogger(FixCalculation.class);
 
-    protected String    river;
-    protected double    from;
-    protected double    to;
-    protected double    step;
-    protected boolean   preprocessing;
-    protected String    function;
-    protected int []    events;
-    protected long [][] analysisPeriods;
-    protected int       qSectorStart;
-    protected int       qSectorEnd;
+    protected String       river;
+    protected double       from;
+    protected double       to;
+    protected double       step;
+    protected boolean      preprocessing;
+    protected String       function;
+    protected int []       events;
+    protected DateRange [] analysisPeriods;
+    protected int          qSectorStart;
+    protected int          qSectorEnd;
 
     public FixCalculation() {
     }
 
     public FixCalculation(FixationArtifactAccess access) {
 
-        String    river           = access.getRiver();
-        Double    from            = access.getFrom();
-        Double    to              = access.getTo();
-        Double    step            = access.getStep();
-        String    function        = access.getFunction();
-        int []    events          = access.getEvents();
-        long [][] analysisPeriods = access.getAnalysisPeriods();
-        Integer   qSectorStart    = access.getQSectorStart();
-        Integer   qSectorEnd      = access.getQSectorEnd();
+        String    river              = access.getRiver();
+        Double    from               = access.getFrom();
+        Double    to                 = access.getTo();
+        Double    step               = access.getStep();
+        String    function           = access.getFunction();
+        int []    events             = access.getEvents();
+        DateRange [] analysisPeriods = access.getAnalysisPeriods();
+        Integer   qSectorStart       = access.getQSectorStart();
+        Integer   qSectorEnd         = access.getQSectorEnd();
 
         if (river == null) {
             // TODO: i18n
@@ -369,14 +368,12 @@
         for (int i = 0; i < columns.length; ++i) {
 
             // Construct filter for period.
-            long [] period = analysisPeriods[i];
+            DateRange period = analysisPeriods[i];
 
             AndFilter filter = new AndFilter();
 
             DateRangeFilter dateRangeFilter =
-                new DateRangeFilter(
-                    new Date(period[0]),
-                    new Date(period[1]));
+                new DateRangeFilter(period.getFrom(), period.getTo());
 
             filter.add(dateRangeFilter);
             filter.add(sectorRangeFilter);

http://dive4elements.wald.intevation.org