comparison flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQFacet.java @ 5831:bd047b71ab37

Repaired internal references
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 12:06:39 +0200
parents flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQFacet.java@5a28312aee99
children
comparison
equal deleted inserted replaced
5830:160f53ee0870 5831:bd047b71ab37
1 package org.dive4elements.river.artifacts.model;
2
3 import org.dive4elements.artifacts.Artifact;
4 import org.dive4elements.artifacts.CallContext;
5
6 import org.dive4elements.artifactdatabase.state.DefaultFacet;
7
8 import org.dive4elements.river.artifacts.WQKmsInterpolArtifact;
9
10 /**
11 * Facet to show W|Q Values.
12 */
13 public class WQFacet
14 extends DefaultFacet
15 implements FacetTypes {
16
17 /** Trivial Constructor. */
18 public WQFacet(String description) {
19 this(STATIC_WQ, description);
20 }
21
22
23 /**
24 * A Facet with WQ data.
25 */
26 public WQFacet(String name, String description) {
27 this.name = name;
28 this.description = description;
29 this.index = 0;
30 }
31
32
33 /**
34 * Returns the data this facet provides at km given in context.
35 *
36 * @param artifact the owner artifact.
37 * @param context the CallContext.
38 *
39 * @return the data.
40 */
41 @Override
42 public Object getData(Artifact artifact, CallContext context) {
43 WQKmsInterpolArtifact interpolData =
44 (WQKmsInterpolArtifact) artifact;
45 Double currentKm = (Double)context.getContextValue("currentKm");
46 return interpolData.getWQAtKm(currentKm);
47 }
48
49
50 /**
51 * Create a deep copy of this Facet.
52 * @return a deep copy.
53 */
54 @Override
55 public WQKmsFacet deepCopy() {
56 WQKmsFacet copy = new WQKmsFacet(description);
57 copy.set(this);
58 return copy;
59 }
60 }
61 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org