comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKmsFacet.java @ 2424:092e519ff461

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

http://dive4elements.wald.intevation.org