Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java @ 687:06689035024c facets-slt
Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
flys-artifacts/branches/facets-slt@2127 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 16 Jun 2011 07:50:56 +0000 |
parents | fdc898a134a7 |
children | f8ac04b2dbd0 |
comparison
equal
deleted
inserted
replaced
686:3dc61e00385e | 687:06689035024c |
---|---|
1 package de.intevation.flys.artifacts.states; | 1 package de.intevation.flys.artifacts.states; |
2 | 2 |
3 import java.util.List; | |
4 | |
3 import org.apache.log4j.Logger; | 5 import org.apache.log4j.Logger; |
6 | |
7 import de.intevation.artifactdatabase.state.Facet; | |
8 | |
9 import de.intevation.flys.artifacts.FLYSArtifact; | |
10 import de.intevation.flys.artifacts.WINFOArtifact; | |
11 import de.intevation.flys.artifacts.model.ComputeCallback; | |
4 | 12 |
5 /** | 13 /** |
6 * The final state that will be reached after the duration curve calculation | 14 * The final state that will be reached after the duration curve calculation |
7 * mode has been chosen. | 15 * mode has been chosen. |
8 * | 16 * |
13 /** The logger that is used in this state.*/ | 21 /** The logger that is used in this state.*/ |
14 private static Logger logger = Logger.getLogger(DurationCurveState.class); | 22 private static Logger logger = Logger.getLogger(DurationCurveState.class); |
15 | 23 |
16 public DurationCurveState() { | 24 public DurationCurveState() { |
17 } | 25 } |
26 | |
27 | |
28 @Override | |
29 public ComputeCallback createComputeCallback( | |
30 String hash, FLYSArtifact flys) | |
31 { | |
32 final WINFOArtifact winfo = (WINFOArtifact) flys; | |
33 | |
34 return new ComputeCallback() { | |
35 public Object compute(List<Facet> facets) { | |
36 return winfo.getDurationCurveData(); | |
37 } | |
38 }; | |
39 } | |
18 } | 40 } |
19 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 41 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |