Mercurial > dive4elements > river
view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/SQMeasurementFacet.java @ 4357:11cf29eb002c
FacetTypes: New type: exreme_wq_curve_base (for the Stuetz-Q-Poits).
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 02 Nov 2012 11:58:11 +0100 |
parents | 1df6984628c3 |
children |
line wrap: on
line source
package de.intevation.flys.artifacts.model.sq; import org.apache.log4j.Logger; import de.intevation.artifacts.Artifact; import de.intevation.artifacts.CallContext; import de.intevation.flys.artifacts.FLYSArtifact; import de.intevation.flys.artifacts.model.CalculationResult; import de.intevation.flys.artifacts.model.DataFacet; import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.states.DefaultState.ComputeType; /** * Facet to show the outliers in a sq relation. * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class SQMeasurementFacet extends DataFacet implements FacetTypes { private static final Logger log = Logger.getLogger(SQMeasurementFacet.class); private int fractionIdx; public SQMeasurementFacet() { } public SQMeasurementFacet( int idx, int fractionIdx, String name, String description, String hash, String stateId ) { super(idx, name, description, ComputeType.ADVANCE, hash, stateId); this.fractionIdx = fractionIdx; } @Override public Object getData(Artifact artifact, CallContext context) { log.debug("SQMeasurementFacet.getData"); if (!(artifact instanceof FLYSArtifact)) { return null; } FLYSArtifact flys = (FLYSArtifact) artifact; CalculationResult res = (CalculationResult) flys.compute( context, ComputeType.ADVANCE, false); SQResult[] result = (SQResult[]) res.getData(); SQFractionResult fResult = result[index].getFraction(fractionIdx); return fResult.getMeasurements(); } @Override public SQMeasurementFacet deepCopy() { SQMeasurementFacet copy = new SQMeasurementFacet(); copy.set(this); return copy; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :