Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalDischargeFacet.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/HistoricalDischargeFacet.java@49cb65d5932d |
children |
comparison
equal
deleted
inserted
replaced
5830:160f53ee0870 | 5831:bd047b71ab37 |
---|---|
1 package org.dive4elements.river.artifacts.model; | |
2 | |
3 import org.apache.log4j.Logger; | |
4 | |
5 import org.dive4elements.artifacts.Artifact; | |
6 import org.dive4elements.artifacts.CallContext; | |
7 | |
8 import org.dive4elements.artifactdatabase.state.Facet; | |
9 | |
10 import org.dive4elements.river.artifacts.FLYSArtifact; | |
11 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; | |
12 | |
13 | |
14 /** | |
15 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
16 */ | |
17 public class HistoricalDischargeFacet extends DataFacet { | |
18 | |
19 private static final Logger logger = | |
20 Logger.getLogger(HistoricalDischargeFacet.class); | |
21 | |
22 | |
23 public HistoricalDischargeFacet() { | |
24 } | |
25 | |
26 | |
27 public HistoricalDischargeFacet(int index, String name, String desc) { | |
28 super(index, name, desc, ComputeType.ADVANCE, null, null); | |
29 } | |
30 | |
31 | |
32 public HistoricalDischargeFacet( | |
33 int index, | |
34 String name, | |
35 String description, | |
36 ComputeType type, | |
37 String stateID, | |
38 String hash | |
39 | |
40 ) { | |
41 super(index, name, description, type, hash, stateID); | |
42 } | |
43 | |
44 | |
45 @Override | |
46 public Facet deepCopy() { | |
47 WaterlevelFacet copy = new WaterlevelFacet(); | |
48 copy.set(this); | |
49 copy.type = type; | |
50 copy.hash = hash; | |
51 copy.stateId = stateId; | |
52 return copy; | |
53 } | |
54 | |
55 | |
56 @Override | |
57 public Object getData(Artifact artifact, CallContext context) { | |
58 if (logger.isDebugEnabled()) { | |
59 logger.debug("Get data for historical discharge curves at index: " + | |
60 index + " / stateId: " + stateId); | |
61 } | |
62 | |
63 FLYSArtifact flys = (FLYSArtifact) artifact; | |
64 | |
65 CalculationResult res = (CalculationResult) | |
66 flys.compute(context, hash, stateId, type, false); | |
67 | |
68 HistoricalDischargeData data = (HistoricalDischargeData) res.getData(); | |
69 WQTimerange[] wqts = (WQTimerange[]) data.getWQTimeranges(); | |
70 | |
71 return wqts[index]; | |
72 } | |
73 } | |
74 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |