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.model.minfo; rrenkert@5764: rrenkert@5764: import org.apache.log4j.Logger; rrenkert@5764: teichmann@5831: import org.dive4elements.artifactdatabase.state.Facet; teichmann@5831: import org.dive4elements.artifacts.Artifact; teichmann@5831: import org.dive4elements.artifacts.CallContext; teichmann@5867: import org.dive4elements.river.artifacts.D4EArtifact; teichmann@5831: import org.dive4elements.river.artifacts.model.DataFacet; teichmann@5831: import org.dive4elements.river.artifacts.model.FacetTypes; teichmann@5831: import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; rrenkert@5764: rrenkert@5764: rrenkert@5764: public class MorphologicWidthFacet rrenkert@5764: extends DataFacet rrenkert@5764: implements FacetTypes rrenkert@5764: { rrenkert@5764: private static Logger logger = Logger.getLogger(SedimentLoadFacet.class); rrenkert@5764: rrenkert@5764: rrenkert@5764: public MorphologicWidthFacet() { rrenkert@5764: } rrenkert@5764: rrenkert@5764: public MorphologicWidthFacet(String facetName, String description) { rrenkert@5764: super(facetName, description); rrenkert@5764: } rrenkert@5764: rrenkert@5764: public MorphologicWidthFacet(int idx, String name, String description, rrenkert@5764: ComputeType type, String stateId, String hash) { rrenkert@5764: super(idx, name, description, type, hash, stateId); rrenkert@5764: } rrenkert@5764: rrenkert@5764: public Object getData(Artifact artifact, CallContext context) { rrenkert@5764: teichmann@5867: D4EArtifact flys = (D4EArtifact) artifact; rrenkert@5764: String width_id = flys.getDataAsString("width_id"); rrenkert@5764: rrenkert@5764: MorphologicWidth width = rrenkert@5764: MorphologicWidthFactory.getWidth(Integer.valueOf(width_id)); rrenkert@5764: rrenkert@5764: return width; rrenkert@5764: } rrenkert@5764: rrenkert@5764: /** Copy deeply. */ rrenkert@5764: @Override rrenkert@5764: public Facet deepCopy() { rrenkert@5764: MorphologicWidthFacet copy = new MorphologicWidthFacet(); rrenkert@5764: copy.set(this); rrenkert@5764: copy.type = type; rrenkert@5764: copy.hash = hash; rrenkert@5764: copy.stateId = stateId; rrenkert@5764: return copy; rrenkert@5764: } rrenkert@5764: }