annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKmsFacet.java @ 2567:1d1cf502a360

fix flys/issue638 (area between certain datatypes). flys-artifacts/trunk@4093 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 27 Feb 2012 10:49:20 +0000
parents fd9aece97aa3
children 0f7abd95c6e2
rev   line source
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.model;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
2
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
3 import org.apache.log4j.Logger;
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
4
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
5 import de.intevation.artifacts.Artifact;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
6 import de.intevation.artifacts.CallContext;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
7
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
8 import de.intevation.flys.artifacts.StaticWQKmsArtifact;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
9 import de.intevation.flys.artifacts.model.FacetTypes;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
11 import de.intevation.flys.artifacts.states.DefaultState.ComputeType;
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
12
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
13
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
14 /**
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15 * Facet to show W|Q|km Values.
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
16 * We have following 'Types' (from FacetTypes):
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
17 * String STATIC_WQKMS = "other.wqkms";
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
18 * String STATIC_WQMS_W = "other.wqkms.w";
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
19 * String STATIC_WQKMS_Q = "other.wqkms.q";
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
20 */
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
21 public class WQKmsFacet
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
22 extends DataFacet
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
23 implements FacetTypes {
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
24
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
25 /** House logger. */
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
26 private static Logger logger = Logger.getLogger(WQKmsFacet.class);
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
27
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28 /** Trivial Constructor. */
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
29 public WQKmsFacet(String description) {
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
30 this(STATIC_WQKMS, description);
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
31 }
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
32
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
33
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
34 /**
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
35 * @param name Name of this facet (we have at least two flavors (w and q).
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
36 */
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
37 public WQKmsFacet(String name, String description) {
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
38 super(0, name, description, ComputeType.FEED, null, null);
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
39 }
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
40
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
41
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
42 /**
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
43 * Returns the data this facet requires.
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
44 *
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
45 * @param artifact the owner artifact.
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
46 * @param context the CallContext (ignored).
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
47 *
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
48 * @return the data.
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
49 */
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
50 @Override
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
51 public Object getData(Artifact artifact, CallContext context) {
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
52 logger.debug("WQKmsFacet.getData");
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
53
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
54 StaticWQKmsArtifact staticData =
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
55 (StaticWQKmsArtifact) artifact;
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
56 Object res = staticData.compute(context, hash, stateId, type, false);
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
57
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
58 return res;
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
59 }
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
60
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
61
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
62 /**
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
63 * Create a deep copy of this Facet.
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
64 * @return a deep copy.
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
65 */
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
66 @Override
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
67 public WQKmsFacet deepCopy() {
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
68 WQKmsFacet copy = new WQKmsFacet(description);
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
69 copy.set(this);
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
70 return copy;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
71 }
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
72 }
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
73 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org