Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DifferenceCurveFacet.java @ 3468:f37e7e8907cb
merged flys-artifacts/2.8.1
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:39 +0200 |
parents | ed07dd55f487 |
children |
comparison
equal
deleted
inserted
replaced
3387:5ffad8bde8ad | 3468:f37e7e8907cb |
---|---|
1 package de.intevation.flys.artifacts.model; | |
2 | |
3 import org.apache.log4j.Logger; | |
4 | |
5 import de.intevation.artifactdatabase.state.Facet; | |
6 import de.intevation.artifacts.Artifact; | |
7 import de.intevation.artifacts.CallContext; | |
8 import de.intevation.flys.artifacts.WINFOArtifact; | |
9 import de.intevation.flys.artifacts.states.DefaultState.ComputeType; | |
10 | |
11 | |
12 /** | |
13 * Facet with the curve of a subtraction of two waterlevel-lines. | |
14 * TODO inherit directly from DataFacet? Check whether this Facet is obsolete. | |
15 */ | |
16 public class DifferenceCurveFacet extends WaterlevelFacet { | |
17 | |
18 private static Logger logger = Logger.getLogger(DifferenceCurveFacet.class); | |
19 | |
20 | |
21 public DifferenceCurveFacet() { | |
22 } | |
23 | |
24 public DifferenceCurveFacet( | |
25 int index, | |
26 String name, | |
27 String description, | |
28 ComputeType type, | |
29 String stateID, | |
30 String hash | |
31 | |
32 ) { | |
33 super(index, name, description, type, stateID, hash); | |
34 } | |
35 | |
36 /** | |
37 * Get difference curve data. | |
38 * @return a WKms at given index. | |
39 */ | |
40 @Override | |
41 public Object getData(Artifact artifact, CallContext context) { | |
42 WINFOArtifact winfo = (WINFOArtifact)artifact; | |
43 | |
44 CalculationResult res = (CalculationResult) | |
45 winfo.compute(context, hash, stateId, type, false); | |
46 | |
47 WKms [] wkms = (WKms [])res.getData(); | |
48 | |
49 WKms result = wkms[index]; | |
50 logger.debug("Got difference curve data (" + result.getName() | |
51 + ") at index: " + index); | |
52 | |
53 return result; | |
54 } | |
55 | |
56 | |
57 /** Copy deeply. */ | |
58 @Override | |
59 public Facet deepCopy() { | |
60 WaterlevelFacet copy = new DifferenceCurveFacet(); | |
61 copy.set(this); | |
62 copy.type = type; | |
63 copy.stateId = stateId; | |
64 copy.hash = hash; | |
65 return copy; | |
66 } | |
67 } | |
68 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |