teichmann@5863: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5863: * Software engineering by Intevation GmbH teichmann@5863: * teichmann@5863: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5863: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5863: * documentation coming with Dive4Elements River for details. teichmann@5863: */ teichmann@5863: teichmann@5831: package org.dive4elements.river.artifacts.access; sascha@3209: ingo@3426: import java.util.Date; ingo@3426: ingo@3426: import org.apache.log4j.Logger; ingo@3426: teichmann@5867: import org.dive4elements.river.artifacts.D4EArtifact; teichmann@5831: import org.dive4elements.river.artifacts.model.DateRange; sascha@3210: sascha@3209: public class SQRelationAccess sascha@3777: extends RiverAccess sascha@3209: { sascha@3209: private static Logger log = Logger.getLogger(SQRelationAccess.class); sascha@3209: ingo@3426: protected Double location; sascha@3210: ingo@3426: protected DateRange period; sascha@3210: ingo@3426: protected Double outliers; sascha@3209: rrenkert@5396: private String method; rrenkert@5396: sascha@3209: public SQRelationAccess() { sascha@3209: } sascha@3209: teichmann@5867: public SQRelationAccess(D4EArtifact artifact) { sascha@3209: super(artifact); sascha@3209: } sascha@3209: sascha@3210: public Double getLocation() { sascha@3210: if (location == null) { sascha@3210: // XXX: The parameter name suggests plural!? sascha@3210: location = getDouble("ld_locations"); sascha@3210: } sascha@3210: sascha@3210: if (log.isDebugEnabled()) { sascha@3210: log.debug("location: " + location); sascha@3210: } sascha@3210: sascha@3210: return location; sascha@3210: } sascha@3210: ingo@3426: public DateRange getPeriod() { ingo@3426: if (period == null) { ingo@3426: Long start = getLong("start"); ingo@3426: Long end = getLong("end"); ingo@3426: ingo@3426: if (start != null && end != null) { ingo@3426: period = new DateRange(new Date(start), new Date(end)); ingo@3426: } sascha@3210: } ingo@3426: ingo@3426: return period; sascha@3210: } sascha@3210: sascha@3210: public Double getOutliers() { sascha@3210: if (outliers == null) { sascha@3210: outliers = getDouble("outliers"); sascha@3210: } sascha@3210: if (log.isDebugEnabled()) { sascha@3210: log.debug("outliers: " + outliers); sascha@3210: } sascha@3210: return outliers; sascha@3210: } rrenkert@5396: rrenkert@5396: public String getOutlierMethod() { rrenkert@5396: if (method == null) { rrenkert@5396: method = getString("outlier-method"); rrenkert@5396: } rrenkert@5396: if (log.isDebugEnabled()) { rrenkert@5396: log.debug("outlier-method: " + method); rrenkert@5396: } rrenkert@5396: return method; rrenkert@5396: } sascha@3209: } sascha@3209: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :