comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKmsFacet.java @ 3468:f37e7e8907cb

merged flys-artifacts/2.8.1
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:39 +0200
parents 0f7abd95c6e2
children
comparison
equal deleted inserted replaced
3387:5ffad8bde8ad 3468:f37e7e8907cb
1 package de.intevation.flys.artifacts.model;
2
3 import org.apache.log4j.Logger;
4
5 import de.intevation.artifacts.Artifact;
6 import de.intevation.artifacts.CallContext;
7
8 import de.intevation.flys.artifacts.StaticWQKmsArtifact;
9
10 import de.intevation.flys.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