comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixOutlierFacet.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 7660cfe5e8f6
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(FixOutlierFacet.class); 30 private static Logger logger = Logger.getLogger(FixOutlierFacet.class);
31 31
32 private double currentKm;
33
32 /** Trivial Constructor. */ 34 /** Trivial Constructor. */
33 public FixOutlierFacet() { 35 public FixOutlierFacet() {
34 } 36 }
35 37
36 38
37 /** 39 /**
38 * @param name 40 * @param name
39 */ 41 */
40 public FixOutlierFacet(String name, String description) { 42 public FixOutlierFacet(String name, String description) {
41 super(0, name, description, ComputeType.ADVANCE, null, null); 43 super(0, name, description, ComputeType.ADVANCE, null, null);
44 }
45
46
47 public Object getData(Artifact artifact, CallContext context, double km) {
48 this.currentKm = km;
49 return getData(artifact, context);
42 } 50 }
43 51
44 52
45 /** 53 /**
46 * Returns the data this facet requires. 54 * Returns the data this facet requires.
63 ComputeType.ADVANCE, 71 ComputeType.ADVANCE,
64 false); 72 false);
65 73
66 FixResult result = (FixResult) res.getData(); 74 FixResult result = (FixResult) res.getData();
67 75
68 double km = access.getCurrentKm();
69 KMIndex<QW []> kmQWs = result.getOutliers(); 76 KMIndex<QW []> kmQWs = result.getOutliers();
70 77
71 KMIndex.Entry<QW []> qwsEntry = kmQWs.binarySearch(km); 78 KMIndex.Entry<QW []> qwsEntry = kmQWs.binarySearch(currentKm);
72 QW[] qws = null; 79 QW[] qws = null;
73 if(qwsEntry != null) { 80 if(qwsEntry != null) {
74 qws = qwsEntry.getValue(); 81 qws = qwsEntry.getValue();
75 } 82 }
76 return qws; 83 return qws;

http://dive4elements.wald.intevation.org