annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DataFacet.java @ 921:610d0e0f4f85

#159 Modifications in the transition model to support a state with a kilometer range input only. flys-artifacts/trunk@2270 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 30 Jun 2011 11:32:17 +0000
parents c09c9e05ecfa
children 3fd891d5228d
rev   line source
702
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.model;
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
3 import de.intevation.artifacts.Artifact;
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
4 import de.intevation.artifacts.CallContext;
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
5
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
6 import de.intevation.artifactdatabase.state.DefaultFacet;
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
7
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
8 import de.intevation.flys.artifacts.FLYSArtifact;
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
9
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10 import de.intevation.flys.artifacts.states.DefaultState.ComputeType;
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
11
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
12 public class DataFacet
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
13 extends DefaultFacet
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
14 {
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
15 protected ComputeType type;
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
16 protected String hash;
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
17
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
18 public DataFacet(String name, String description) {
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19 this(name, description, ComputeType.ADVANCE);
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20 }
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
21
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
22 public DataFacet(String name, String description, ComputeType type) {
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23 this(name, description, type, null);
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
24 }
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
25
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26 public DataFacet(
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
27 String name,
742
c09c9e05ecfa Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 705
diff changeset
28 String description,
702
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29 ComputeType type,
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30 String hash
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31 ) {
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32 super(name, description);
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33 this.type = type;
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
34 this.hash = hash;
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
35 }
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
36
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
37 public Object getData(Artifact artifact, CallContext context) {
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
38 FLYSArtifact flys = (FLYSArtifact)artifact;
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
39 return flys.compute(
705
853dceead0f4 Only generate facets when needed.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 702
diff changeset
40 context, hash != null ? hash : flys.hash(), type, false);
702
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
41 }
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
42 }
32ed5d789e50 Add facet to access raw computed data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
43 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org