view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DurationCurveFacet.java @ 700:94f0f91be11c facets-slt

call computeAdvance() if we want to advance. flys-artifacts/branches/facets-slt@2150 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 17 Jun 2011 13:10:20 +0000
parents b972eba2ed8a
children 853dceead0f4
line wrap: on
line source
package de.intevation.flys.artifacts.model;

import org.apache.log4j.Logger;

import de.intevation.artifacts.Artifact;
import de.intevation.artifacts.CallContext;

import de.intevation.artifactdatabase.state.DefaultFacet;

import de.intevation.flys.artifacts.WINFOArtifact;

import de.intevation.flys.artifacts.states.DefaultState.ComputeType;


public class DurationCurveFacet extends DefaultFacet {

    private static Logger logger = Logger.getLogger(DurationCurveFacet.class);


    public DurationCurveFacet(int index, String name, String description) {
        super(index, name, description);
    }


    public Object getData(Artifact artifact, CallContext context) {
        logger.debug("Get data for duration curve data at index: " + index);

        WINFOArtifact winfo = (WINFOArtifact) artifact;

        WQDay[] wqday = (WQDay[]) winfo.compute(context, ComputeType.ADVANCE);

        return wqday[index];
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org