view flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/SQRelationAccess.java @ 5396:aaf810d4ec82

Use new state 'outlier mehtod selection' in SQ-relation. The outlier method is no more configurable in conf.xml. The user can now select the method in SQ-relation parameters.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 25 Mar 2013 12:40:26 +0100
parents 048a02e29808
children
line wrap: on
line source
package de.intevation.flys.artifacts.access;

import java.util.Date;

import org.apache.log4j.Logger;

import de.intevation.flys.artifacts.FLYSArtifact;
import de.intevation.flys.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 :

http://dive4elements.wald.intevation.org