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; raimund@3614: teichmann@5831: import org.dive4elements.artifacts.Artifact; teichmann@5831: import org.dive4elements.artifacts.CallContext; teichmann@5831: import org.dive4elements.river.artifacts.FLYSArtifact; teichmann@5831: import org.dive4elements.river.artifacts.access.BedHeightAccess; teichmann@5831: import org.dive4elements.river.artifacts.model.BlackboardDataFacet; teichmann@5831: import org.dive4elements.river.artifacts.model.FacetTypes; raimund@3614: raimund@3614: public class BedHeightFacet raimund@3614: extends BlackboardDataFacet raimund@3614: implements FacetTypes { raimund@3614: bjoern@4534: private String type; sascha@3633: bjoern@4534: public BedHeightFacet(String name, String description, String type) { raimund@3614: this.name = name; raimund@3614: this.description = description; bjoern@4534: this.type = type; raimund@3614: this.index = 0; raimund@3614: } raimund@3614: raimund@3614: /** raimund@3614: * Returns the data this facet requires. raimund@3614: * raimund@3614: * @param artifact the owner artifact. raimund@3614: * @param context the CallContext (ignored). raimund@3614: * raimund@3614: * @return the data. raimund@3614: */ raimund@3614: @Override raimund@3614: public Object getData(Artifact artifact, CallContext context) { felix@4826: BedHeightAccess access = new BedHeightAccess((FLYSArtifact)artifact, context); bjoern@4534: if (type.equals("singlevalues")) { bjoern@4655: return access.getSingleValues(); bjoern@4534: } bjoern@4655: return access.getHeight(); raimund@3614: } raimund@3614: /** raimund@3614: * Create a deep copy of this Facet. raimund@3614: * @return a deep copy. raimund@3614: */ raimund@3614: @Override raimund@3614: public BedHeightFacet deepCopy() { bjoern@4534: BedHeightFacet copy = new BedHeightFacet(name, description, type); raimund@3614: copy.set(this); raimund@3614: return copy; raimund@3614: } raimund@3614: } raimund@3614: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :