Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKmsFacet.java @ 2124:a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
flys-artifacts/trunk@3694 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 17 Jan 2012 08:17:50 +0000 |
parents | 02cd002205a3 |
children | fd9aece97aa3 |
comparison
equal
deleted
inserted
replaced
2123:907322e269e3 | 2124:a202a9e048a5 |
---|---|
1 package de.intevation.flys.artifacts.model; | 1 package de.intevation.flys.artifacts.model; |
2 | |
3 import org.apache.log4j.Logger; | |
2 | 4 |
3 import de.intevation.artifacts.Artifact; | 5 import de.intevation.artifacts.Artifact; |
4 import de.intevation.artifacts.CallContext; | 6 import de.intevation.artifacts.CallContext; |
5 | 7 |
6 import de.intevation.artifactdatabase.state.DefaultFacet; | |
7 | |
8 import de.intevation.flys.artifacts.StaticWQKmsArtifact; | 8 import de.intevation.flys.artifacts.StaticWQKmsArtifact; |
9 import de.intevation.flys.artifacts.model.FacetTypes; | 9 import de.intevation.flys.artifacts.model.FacetTypes; |
10 | 10 |
11 import de.intevation.flys.artifacts.states.DefaultState; | |
12 import de.intevation.flys.artifacts.states.DefaultState.ComputeType; | |
13 | |
14 | |
11 /** | 15 /** |
12 * Facet to show W|Q|km Values. | 16 * Facet to show W|Q|km Values. |
17 * We have following 'Types' (from FacetTypes): | |
18 * String STATIC_WQKMS = "other.wqkms"; | |
19 * String STATIC_WQMS_W = "other.wqkms.w"; | |
20 * String STATIC_WQKMS_Q = "other.wqkms.q"; | |
13 */ | 21 */ |
14 public class WQKmsFacet | 22 public class WQKmsFacet |
15 extends DefaultFacet | 23 extends DataFacet |
16 implements FacetTypes { | 24 implements FacetTypes { |
25 | |
26 /** House logger. */ | |
27 private static Logger logger = Logger.getLogger(WQKmsFacet.class); | |
17 | 28 |
18 /** Trivial Constructor. */ | 29 /** Trivial Constructor. */ |
19 public WQKmsFacet(String description) { | 30 public WQKmsFacet(String description) { |
20 this(STATIC_WQKMS, description); | 31 this(STATIC_WQKMS, description); |
21 } | 32 } |
22 | 33 |
34 | |
35 /** | |
36 * @param name Name of this facet (we have at least two flavors (w and q). | |
37 */ | |
23 public WQKmsFacet(String name, String description) { | 38 public WQKmsFacet(String name, String description) { |
24 this.name = name; | 39 super(0, name, description, ComputeType.FEED, null, null); |
25 this.description = description; | |
26 this.index = 0; | |
27 } | 40 } |
28 | 41 |
29 | 42 |
30 /** | 43 /** |
31 * Returns the data this facet requires. | 44 * Returns the data this facet requires. |
35 * | 48 * |
36 * @return the data. | 49 * @return the data. |
37 */ | 50 */ |
38 @Override | 51 @Override |
39 public Object getData(Artifact artifact, CallContext context) { | 52 public Object getData(Artifact artifact, CallContext context) { |
53 logger.debug("WQKmsFacet.getData"); | |
54 | |
40 StaticWQKmsArtifact staticData = | 55 StaticWQKmsArtifact staticData = |
41 (StaticWQKmsArtifact) artifact; | 56 (StaticWQKmsArtifact) artifact; |
42 return staticData.getWQKms(0); | 57 Object res = staticData.compute(context, hash, stateId, type, false); |
58 | |
59 return res; | |
43 } | 60 } |
44 | 61 |
45 | 62 |
46 /** | 63 /** |
47 * Create a deep copy of this Facet. | 64 * Create a deep copy of this Facet. |