comparison flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/FlowVelocityFacet.java @ 5831:bd047b71ab37

Repaired internal references
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 12:06:39 +0200
parents flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityFacet.java@756aba0d2a7a
children
comparison
equal deleted inserted replaced
5830:160f53ee0870 5831:bd047b71ab37
1 package org.dive4elements.river.artifacts.model;
2
3 import org.dive4elements.artifactdatabase.state.Facet;
4
5 import org.dive4elements.artifacts.Artifact;
6 import org.dive4elements.artifacts.CallContext;
7
8 import org.dive4elements.river.artifacts.FLYSArtifact;
9
10 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
11
12 import org.apache.log4j.Logger;
13
14 /**
15 * Facet of a FlowVelocity curve.
16 */
17 public class FlowVelocityFacet extends DataFacet {
18
19 private static Logger logger = Logger.getLogger(FlowVelocityFacet.class);
20
21 public FlowVelocityFacet() {
22 // required for clone operation deepCopy()
23 }
24
25
26 public FlowVelocityFacet(
27 int idx,
28 String name,
29 String description,
30 ComputeType type,
31 String stateId,
32 String hash
33 ) {
34 super(idx, name, description, type, hash, stateId);
35 }
36
37
38 public Object getData(Artifact artifact, CallContext context) {
39 logger.debug("Get data for flow velocity at index: " + index);
40
41 FLYSArtifact flys = (FLYSArtifact) artifact;
42
43 CalculationResult res = (CalculationResult)
44 flys.compute(context, hash, stateId, type, false);
45
46 FlowVelocityData[] data = (FlowVelocityData[]) res.getData();
47
48 return data[index];
49 }
50
51
52 /** Copy deeply. */
53 @Override
54 public Facet deepCopy() {
55 FlowVelocityFacet copy = new FlowVelocityFacet();
56 copy.set(this);
57 copy.type = type;
58 copy.hash = hash;
59 copy.stateId = stateId;
60 return copy;
61 }
62 }
63 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org