Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/org/dive4elements/river/artifacts/access/SQRelationAccess.java @ 5831:bd047b71ab37
Repaired internal references
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 12:06:39 +0200 |
parents | flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/SQRelationAccess.java@aaf810d4ec82 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/org/dive4elements/river/artifacts/access/SQRelationAccess.java Thu Apr 25 12:06:39 2013 +0200 @@ -0,0 +1,76 @@ +package org.dive4elements.river.artifacts.access; + +import java.util.Date; + +import org.apache.log4j.Logger; + +import org.dive4elements.river.artifacts.FLYSArtifact; +import org.dive4elements.river.artifacts.model.DateRange; + +public class SQRelationAccess +extends RiverAccess +{ + private static Logger log = Logger.getLogger(SQRelationAccess.class); + + protected Double location; + + protected DateRange period; + + protected Double outliers; + + private String method; + + public SQRelationAccess() { + } + + public SQRelationAccess(FLYSArtifact artifact) { + super(artifact); + } + + 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 getPeriod() { + if (period == null) { + Long start = getLong("start"); + Long end = getLong("end"); + + if (start != null && end != null) { + period = new DateRange(new Date(start), new Date(end)); + } + } + + return period; + } + + public Double getOutliers() { + if (outliers == null) { + outliers = getDouble("outliers"); + } + if (log.isDebugEnabled()) { + log.debug("outliers: " + outliers); + } + return outliers; + } + + public String getOutlierMethod() { + if (method == null) { + method = getString("outlier-method"); + } + if (log.isDebugEnabled()) { + log.debug("outlier-method: " + method); + } + return method; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :