comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/math/DifferenceCurveFacet.java @ 2122:81312f84689a

Refactored to easier enjoy benefits of caching. flys-artifacts/trunk@3692 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 17 Jan 2012 08:01:22 +0000
parents 8afd6a9bb244
children 5642a83420f2
comparison
equal deleted inserted replaced
2121:70ef5fdc7414 2122:81312f84689a
12 import de.intevation.flys.artifacts.states.DefaultState.ComputeType; 12 import de.intevation.flys.artifacts.states.DefaultState.ComputeType;
13 13
14 14
15 /** 15 /**
16 * Facet with the curve of a subtraction of two waterlevel-lines. 16 * Facet with the curve of a subtraction of two waterlevel-lines.
17 * TODO inherit directly from DataFacet? Check whether this Facet is obsolete.
17 */ 18 */
18 public class DifferenceCurveFacet extends WaterlevelFacet { 19 public class DifferenceCurveFacet extends WaterlevelFacet {
19 20
20 private static Logger logger = Logger.getLogger(DifferenceCurveFacet.class); 21 private static Logger logger = Logger.getLogger(DifferenceCurveFacet.class);
21 22
42 @Override 43 @Override
43 public Object getData(Artifact artifact, CallContext context) { 44 public Object getData(Artifact artifact, CallContext context) {
44 WINFOArtifact winfo = (WINFOArtifact)artifact; 45 WINFOArtifact winfo = (WINFOArtifact)artifact;
45 46
46 CalculationResult res = (CalculationResult) 47 CalculationResult res = (CalculationResult)
47 winfo.compute(context, hash, stateID, type, false); 48 winfo.compute(context, hash, stateId, type, false);
48 49
49 WKms [] wkms = (WKms [])res.getData(); 50 WKms [] wkms = (WKms [])res.getData();
50 51
51 WKms result = wkms[index]; 52 WKms result = wkms[index];
52 logger.debug("Got difference curve data (" + result.getName() 53 logger.debug("Got difference curve data (" + result.getName()
60 @Override 61 @Override
61 public Facet deepCopy() { 62 public Facet deepCopy() {
62 WaterlevelFacet copy = new DifferenceCurveFacet(); 63 WaterlevelFacet copy = new DifferenceCurveFacet();
63 copy.set(this); 64 copy.set(this);
64 copy.type = type; 65 copy.type = type;
65 copy.stateID = stateID; 66 copy.stateId = stateId;
66 copy.hash = hash; 67 copy.hash = hash;
67 return copy; 68 return copy;
68 } 69 }
69 } 70 }
70 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 71 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org