felix@1825: package de.intevation.flys.artifacts.model;
felix@1825: 
felix@1825: import de.intevation.artifacts.Artifact;
felix@1825: import de.intevation.artifacts.CallContext;
felix@1825: 
felix@1825: import de.intevation.artifactdatabase.state.DefaultFacet;
felix@1825: 
felix@1825: import de.intevation.flys.artifacts.StaticWQKmsArtifact;
felix@1825: import de.intevation.flys.artifacts.model.FacetTypes;
felix@1825: 
felix@1825: /**
felix@1825:  * Facet to show W|Q|km Values.
felix@1825:  */
felix@1825: public class WQKmsFacet
felix@1825: extends      DefaultFacet
felix@1825: implements   FacetTypes {
felix@1825: 
felix@1825:     /** Trivial Constructor. */
felix@1825:     public WQKmsFacet(String description) {
felix@1825:         this(STATIC_WQKMS, description);
felix@1825:     }
felix@1825: 
felix@1825:     public WQKmsFacet(String name, String description) {
felix@1825:         this.name        = name;
felix@1825:         this.description = description;
felix@1825:         this.index       = 0;
felix@1825:     }
felix@1825: 
felix@1825: 
felix@1825:     /**
felix@1825:      * Returns the data this facet requires.
felix@1825:      *
felix@1825:      * @param artifact the owner artifact.
felix@1825:      * @param context  the CallContext (ignored).
felix@1825:      *
felix@1825:      * @return the data.
felix@1825:      */
felix@1825:     @Override
felix@1825:     public Object getData(Artifact artifact, CallContext context) {
felix@1825:         StaticWQKmsArtifact staticData =
felix@1825:             (StaticWQKmsArtifact) artifact;
felix@1825:         return staticData.getWQKms(0);
felix@1825:     }
felix@1825: 
felix@1825: 
felix@1825:     /**
felix@1825:      * Create a deep copy of this Facet.
felix@1825:      * @return a deep copy.
felix@1825:      */
felix@1825:     @Override
felix@1825:     public WQKmsFacet deepCopy() {
felix@1825:         WQKmsFacet copy = new WQKmsFacet(description);
felix@1825:         copy.set(this);
felix@1825:         return copy;
felix@1825:     }
felix@1825: }
felix@1825: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :