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.fixings; felix@5729: felix@5729: import org.apache.log4j.Logger; felix@5729: teichmann@5831: import org.dive4elements.artifacts.Artifact; teichmann@5831: import org.dive4elements.artifacts.CallContext; felix@5729: 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.model.WQKmsFactory; teichmann@5831: import org.dive4elements.river.artifacts.access.FixRealizingAccess; felix@5729: teichmann@5831: import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; felix@5729: felix@5729: felix@5729: /** felix@5729: * Facet to show W|Q|km Values. felix@5729: */ felix@5729: public class FixEventFacet felix@5729: extends DataFacet felix@5729: implements FacetTypes { felix@5729: felix@5729: /** House logger. */ felix@5729: private static Logger logger = Logger.getLogger(FixEventFacet.class); felix@5729: felix@5729: felix@5729: public FixEventFacet(int index, String name, String description) { felix@5729: super(index, name, description, ComputeType.FEED, null, null); felix@5729: } felix@5729: felix@5729: felix@5729: /** felix@5729: * Returns the data this facet requires. felix@5729: * felix@5729: * @param artifact the owner artifact. felix@5729: * @param context the CallContext (ignored). felix@5729: * felix@5729: * @return the data. felix@5729: */ felix@5729: @Override felix@5729: public Object getData(Artifact artifact, CallContext context) { felix@5729: logger.debug("FixEventFacet.getData"); felix@5729: teichmann@5867: FixRealizingAccess access = new FixRealizingAccess((D4EArtifact) artifact, context); felix@5729: int wstColID = access.getEvents()[index]; felix@5729: return WQKmsFactory.getWQKmsCID(wstColID); felix@5729: } felix@5729: felix@5729: felix@5729: /** felix@5729: * Create a deep copy of this Facet. felix@5729: * @return a deep copy. felix@5729: */ felix@5729: @Override felix@5729: public FixEventFacet deepCopy() { felix@5729: FixEventFacet copy = new FixEventFacet(index, name, description); felix@5729: copy.set(this); felix@5729: return copy; felix@5729: } felix@5729: } felix@5729: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :