Mercurial > dive4elements > river
changeset 3210:ae14f412ba10
SQ: finished the access stuff.
flys-artifacts/trunk@4831 c6561f87-3c4e-4783-a992-168aeb5c3f6f
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Thu Jun 28 15:06:58 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Jun 28 15:46:16 2012 +0000 @@ -1,3 +1,28 @@ +2012-06-28 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/access/SQRelationAccess.java: + Finished the access to the S/Q relation stuff. + + * doc/conf/artifacts/minfo.xml: + State "state.minfo.sq.periods" returns the value as string + symmetrical to state "state.fix.analysisperiods". + + * src/main/java/de/intevation/flys/artifacts/model/fixings/DateRange.java: + Deleted. + + * src/main/java/de/intevation/flys/artifacts/model/DateRange.java: + Re-added here because its of use not only in the fix analysis + but also in the S/Q relation. + + * src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java, + src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisPeriodsFacet.java, + src/main/java/de/intevation/flys/artifacts/model/fixings/AnalysisPeriod.java, + src/main/java/de/intevation/flys/artifacts/access/FixationArtifactAccess.java, + src/main/java/de/intevation/flys/artifacts/access/Access.java, + src/main/java/de/intevation/flys/artifacts/states/fixation/FixationCompute.java, + src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java: + Adjusted the imports for the moved DateRange. + 2012-06-28 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/artifacts/access/SQRelationAccess.java:
--- a/flys-artifacts/doc/conf/artifacts/minfo.xml Thu Jun 28 15:06:58 2012 +0000 +++ b/flys-artifacts/doc/conf/artifacts/minfo.xml Thu Jun 28 15:46:16 2012 +0000 @@ -69,7 +69,7 @@ </state> <state id="state.minfo.sq.periods" description="state.minfo.sq.periods" state="de.intevation.flys.artifacts.states.PeriodsSelect"> - <data name="periods" type="Long[]"/> + <data name="periods" type="String"/> </state> <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/Access.java Thu Jun 28 15:06:58 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/Access.java Thu Jun 28 15:46:16 2012 +0000 @@ -4,7 +4,7 @@ import de.intevation.flys.artifacts.FLYSArtifact; -import de.intevation.flys.artifacts.model.fixings.DateRange; +import de.intevation.flys.artifacts.model.DateRange; import de.intevation.flys.utils.FLYSUtils;
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/FixationArtifactAccess.java Thu Jun 28 15:06:58 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/FixationArtifactAccess.java Thu Jun 28 15:46:16 2012 +0000 @@ -4,7 +4,7 @@ import de.intevation.flys.artifacts.FLYSArtifact; -import de.intevation.flys.artifacts.model.fixings.DateRange; +import de.intevation.flys.artifacts.model.DateRange; import java.util.Arrays; import java.util.Date;
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/SQRelationAccess.java Thu Jun 28 15:06:58 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/SQRelationAccess.java Thu Jun 28 15:46:16 2012 +0000 @@ -2,6 +2,8 @@ import de.intevation.flys.artifacts.FLYSArtifact; +import de.intevation.flys.artifacts.model.DateRange; + import org.apache.log4j.Logger; public class SQRelationAccess @@ -9,7 +11,13 @@ { private static Logger log = Logger.getLogger(SQRelationAccess.class); - protected String river; + protected String river; + + protected Double location; + + protected DateRange [] periods; + + protected Double outliers; public SQRelationAccess() { } @@ -27,5 +35,35 @@ } return river; } + + public Double getLocation() { + if (location == null) { + // XXX: The parameter name suggests plural!? + location = getDouble("ld_locations"); + } + + if (log.isDebugEnabled()) { + log.debug("location: " + location); + } + + return location; + } + + public DateRange [] getPeriods() { + if (periods == null) { + periods = getDateRange("periods"); + } + return periods; + } + + public Double getOutliers() { + if (outliers == null) { + outliers = getDouble("outliers"); + } + if (log.isDebugEnabled()) { + log.debug("outliers: " + outliers); + } + return outliers; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DateRange.java Thu Jun 28 15:46:16 2012 +0000 @@ -0,0 +1,50 @@ +package de.intevation.flys.artifacts.model; + +import java.util.Date; + +import java.io.Serializable; + +public class DateRange +implements Serializable +{ + protected Date from; + protected Date to; + + public DateRange(Date from, Date to) { + this.from = from; + this.to = to; + } + + public Date getFrom() { + return from; + } + + public void setFrom(Date from) { + this.from = from; + } + + public Date getTo() { + return to; + } + + public void setTo(Date to) { + this.to = to; + } + + private static final boolean equalDates(Date a, Date b) { + if (a == null && b != null) return false; + if (a != null && b == null) return false; + if (a == null) return true; + return a.equals(b); + } + + @Override + public boolean equals(Object other) { + if (!(other instanceof DateRange)) { + return false; + } + DateRange o = (DateRange)other; + return equalDates(from, o.from) && equalDates(to, o.to); + } +} +// 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/AnalysisPeriod.java Thu Jun 28 15:06:58 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/AnalysisPeriod.java Thu Jun 28 15:46:16 2012 +0000 @@ -1,5 +1,7 @@ package de.intevation.flys.artifacts.model.fixings; +import de.intevation.flys.artifacts.model.DateRange; + import java.io.Serializable; public class AnalysisPeriod
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/DateRange.java Thu Jun 28 15:06:58 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -package de.intevation.flys.artifacts.model.fixings; - -import java.util.Date; - -import java.io.Serializable; - -public class DateRange -implements Serializable -{ - protected Date from; - protected Date to; - - public DateRange(Date from, Date to) { - this.from = from; - this.to = to; - } - - public Date getFrom() { - return from; - } - - public void setFrom(Date from) { - this.from = from; - } - - public Date getTo() { - return to; - } - - public void setTo(Date to) { - this.to = to; - } - - private static final boolean equalDates(Date a, Date b) { - if (a == null && b != null) return false; - if (a != null && b == null) return false; - if (a == null) return true; - return a.equals(b); - } - - @Override - public boolean equals(Object other) { - if (!(other instanceof DateRange)) { - return false; - } - DateRange o = (DateRange)other; - return equalDates(from, o.from) && equalDates(to, o.to); - } -} -// 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/FixAnalysisPeriodsFacet.java Thu Jun 28 15:06:58 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisPeriodsFacet.java Thu Jun 28 15:46:16 2012 +0000 @@ -9,6 +9,7 @@ import de.intevation.flys.artifacts.model.CalculationResult; import de.intevation.flys.artifacts.model.DataFacet; +import de.intevation.flys.artifacts.model.DateRange; import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.states.DefaultState.ComputeType;
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java Thu Jun 28 15:06:58 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java Thu Jun 28 15:46:16 2012 +0000 @@ -7,6 +7,7 @@ import de.intevation.flys.artifacts.model.Calculation; import de.intevation.flys.artifacts.model.CalculationResult; +import de.intevation.flys.artifacts.model.DateRange; import de.intevation.flys.artifacts.model.FixingsColumn; import de.intevation.flys.artifacts.model.FixingsColumnFactory;
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationCompute.java Thu Jun 28 15:06:58 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationCompute.java Thu Jun 28 15:46:16 2012 +0000 @@ -10,10 +10,10 @@ import de.intevation.flys.artifacts.model.CalculationResult; import de.intevation.flys.artifacts.model.DataFacet; +import de.intevation.flys.artifacts.model.DateRange; import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.ReportFacet; -import de.intevation.flys.artifacts.model.fixings.DateRange; import de.intevation.flys.artifacts.model.fixings.FixAnalysisEventsFacet; import de.intevation.flys.artifacts.model.fixings.FixAnalysisPeriodsFacet; import de.intevation.flys.artifacts.model.fixings.FixAvSectorFacet;
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java Thu Jun 28 15:06:58 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java Thu Jun 28 15:46:16 2012 +0000 @@ -9,9 +9,9 @@ import de.intevation.flys.artifacts.FLYSArtifact; +import de.intevation.flys.artifacts.model.DateRange; import de.intevation.flys.artifacts.model.FacetTypes; -import de.intevation.flys.artifacts.model.fixings.DateRange; import de.intevation.flys.artifacts.model.fixings.QWD; import de.intevation.flys.exports.TimeseriesChartGenerator;