comparison flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKmsFacet.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/WQKmsFacet.java@0f7abd95c6e2
children
comparison
equal deleted inserted replaced
5830:160f53ee0870 5831:bd047b71ab37
1 package org.dive4elements.river.artifacts.model;
2
3 import org.apache.log4j.Logger;
4
5 import org.dive4elements.artifacts.Artifact;
6 import org.dive4elements.artifacts.CallContext;
7
8 import org.dive4elements.river.artifacts.StaticWQKmsArtifact;
9
10 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
11
12
13 /**
14 * Facet to show W|Q|km Values.
15 * We have following 'Types' (from FacetTypes):
16 * String STATIC_WQKMS = "other.wqkms";
17 * String STATIC_WQMS_W = "other.wqkms.w";
18 * String STATIC_WQKMS_Q = "other.wqkms.q";
19 */
20 public class WQKmsFacet
21 extends DataFacet
22 implements FacetTypes {
23
24 /** House logger. */
25 private static Logger logger = Logger.getLogger(WQKmsFacet.class);
26
27 /** Trivial Constructor. */
28 public WQKmsFacet(String description) {
29 this(STATIC_WQKMS, description);
30 }
31
32
33 /**
34 * @param name Name of this facet (we have at least two flavors (w and q).
35 */
36 public WQKmsFacet(String name, String description) {
37 super(0, name, description, ComputeType.FEED, null, null);
38 }
39
40
41 /**
42 * Returns the data this facet requires.
43 *
44 * @param artifact the owner artifact.
45 * @param context the CallContext (ignored).
46 *
47 * @return the data.
48 */
49 @Override
50 public Object getData(Artifact artifact, CallContext context) {
51 logger.debug("WQKmsFacet.getData");
52
53 StaticWQKmsArtifact staticData =
54 (StaticWQKmsArtifact) artifact;
55 Object res = staticData.compute(context, hash, stateId, type, false);
56
57 return res;
58 }
59
60
61 /**
62 * Create a deep copy of this Facet.
63 * @return a deep copy.
64 */
65 @Override
66 public WQKmsFacet deepCopy() {
67 WQKmsFacet copy = new WQKmsFacet(description);
68 copy.set(this);
69 return copy;
70 }
71 }
72 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org