Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisEventsFacet.java @ 3080:dc2765e31e1f
Added getData method with an additional km parameter.
flys-artifacts/trunk@4676 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 15 Jun 2012 12:42:13 +0000 |
parents | 5642a83420f2 |
children | 960307cf2adc |
comparison
equal
deleted
inserted
replaced
3079:8ad8a227d983 | 3080:dc2765e31e1f |
---|---|
27 implements FacetTypes { | 27 implements FacetTypes { |
28 | 28 |
29 /** House logger. */ | 29 /** House logger. */ |
30 private static Logger logger = Logger.getLogger(FixAnalysisEventsFacet.class); | 30 private static Logger logger = Logger.getLogger(FixAnalysisEventsFacet.class); |
31 | 31 |
32 private double currentKm; | |
33 | |
32 /** Trivial Constructor. */ | 34 /** Trivial Constructor. */ |
33 public FixAnalysisEventsFacet() { | 35 public FixAnalysisEventsFacet() { |
34 } | 36 } |
35 | 37 |
36 | 38 |
42 name, | 44 name, |
43 description, | 45 description, |
44 ComputeType.ADVANCE, | 46 ComputeType.ADVANCE, |
45 null, | 47 null, |
46 null); | 48 null); |
49 } | |
50 | |
51 | |
52 public Object getData(Artifact artifact, CallContext context, double km) { | |
53 this.currentKm = km; | |
54 return getData(artifact, context); | |
47 } | 55 } |
48 | 56 |
49 | 57 |
50 /** | 58 /** |
51 * Returns the data this facet requires. | 59 * Returns the data this facet requires. |
68 ComputeType.ADVANCE, | 76 ComputeType.ADVANCE, |
69 false); | 77 false); |
70 | 78 |
71 FixResult result = (FixResult) res.getData(); | 79 FixResult result = (FixResult) res.getData(); |
72 | 80 |
73 double km = access.getCurrentKm(); | |
74 | |
75 KMIndex<AnalysisPeriod []> kmPeriods = result.getAnalysisPeriods(); | 81 KMIndex<AnalysisPeriod []> kmPeriods = result.getAnalysisPeriods(); |
76 KMIndex.Entry<AnalysisPeriod []> kmPeriodsEntry = | 82 KMIndex.Entry<AnalysisPeriod []> kmPeriodsEntry = |
77 kmPeriods.binarySearch(km); | 83 kmPeriods.binarySearch(currentKm); |
78 | 84 |
79 if(kmPeriodsEntry == null) { | 85 if(kmPeriodsEntry == null) { |
80 return null; | 86 return null; |
81 } | 87 } |
82 | 88 |