@Test public void testPrecedingThresholds() throws Exception { System.out.println(" testPrecedingThresholds"); final String[] categories = {"low", "mid", "high", "super"}; final Double[] thresholds = {0.0, 50.0, 100.0}; setupParameters(categories, thresholds); parameters.add(ff2.literal("preceding")); Function fn = finder.findFunction("categorize", parameters); String result; int i; for (i = 0 ;i < thresholds.length; i++) { result = fn.evaluate(feature(thresholds[i].intValue() - 1), String.class); assertEquals(categories[i], result); result = fn.evaluate(feature(thresholds[i].intValue()), String.class); assertEquals(categories[i], result); } result = fn.evaluate(feature(thresholds[thresholds.length - 1].intValue() + 1), String.class); assertEquals(categories[categories.length - 1], result); }
public Object evaluate(Object object) { return evaluate(object, Object.class); }
CategorizeFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } }
CategorizeFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } CategorizeFunction();  CategorizeFunction(List<Expression> parameters, Literal fallback); }
CategorizeFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } CategorizeFunction();  CategorizeFunction(List<Expression> parameters, Literal fallback); String getName(); FunctionName getFunctionName(); List<Expression> getParameters(); Object accept(ExpressionVisitor visitor, Object extraData); Object evaluate(Object object); T evaluate(Object object, Class<T> context); Literal getFallbackValue(); }
CategorizeFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } CategorizeFunction();  CategorizeFunction(List<Expression> parameters, Literal fallback); String getName(); FunctionName getFunctionName(); List<Expression> getParameters(); Object accept(ExpressionVisitor visitor, Object extraData); Object evaluate(Object object); T evaluate(Object object, Class<T> context); Literal getFallbackValue(); static final String SUCCEEDING; static final String PRECEDING; static final String RASTER_DATA; static final FunctionName NAME; }