view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/map/WSPLGENReportFacet.java @ 4241:49cb65d5932d

Improved the historical discharge calculation. The calculation now creates new HistoricalWQKms (new subclass of WQKms). Those WQKms are used to create new facets from (new) type 'HistoricalDischargeCurveFacet'. The chart generator is improved to support those facets.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 24 Oct 2012 14:34:35 +0200
parents e1cf76b3ecb4
children
line wrap: on
line source
package de.intevation.flys.artifacts.model.map;

import org.apache.log4j.Logger;

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

import de.intevation.artifactdatabase.state.Facet;

import de.intevation.flys.artifacts.model.CalculationResult;
import de.intevation.flys.artifacts.model.ReportFacet;
import de.intevation.flys.artifacts.states.DefaultState.ComputeType;


/**
 * This facet is used to provide WSPLGEN reports <b>only</b>.
 */
public class WSPLGENReportFacet extends ReportFacet {

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


    protected CalculationResult result;


    public WSPLGENReportFacet() {
    }


    public WSPLGENReportFacet(
        ComputeType       type,
        String            hash,
        String            stateId,
        CalculationResult result
    ) {
        super(type, hash, stateId);
        this.result = result;
    }


    @Override
    public Object getData(Artifact artifact, CallContext context) {
        return result.getReport();
    }


    @Override
    public Facet deepCopy() {
        WSPLGENReportFacet copy = new WSPLGENReportFacet();
        copy.set(this);
        copy.type    = type;
        copy.hash    = hash;
        copy.stateId = stateId;
        copy.result  = result;
        return copy;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org