@Test public void testForOutOfRangeColorValues() { System.out.println(" out of range color values"); parameters = new ArrayList<Expression>(); parameters.add(ff2.literal("RasterData")); double[] x = { 0, 1, 2, 3, 4, 5 }; int[] reds = { 128, 0, 0, 255, 255, 128 }; for (int i = 0; i < x.length; i++) { parameters.add(ff2.literal(x[i])); String color = String.format("#%02x0000", reds[i]); parameters.add(ff2.literal(color)); } parameters.add(ff2.literal(InterpolateFunction.METHOD_COLOR)); parameters.add(ff2.literal(InterpolateFunction.MODE_CUBIC)); Function fn = finder.findFunction("interpolate", parameters); Color result = fn.evaluate(Double.valueOf(1.5), Color.class); assertEquals(0, result.getRed()); result = fn.evaluate(Double.valueOf(3.5), Color.class); assertEquals(255, result.getRed()); }
public Object evaluate(Object object) { return evaluate(object, Object.class); }
InterpolateFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } }
InterpolateFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } InterpolateFunction();  InterpolateFunction(List<Expression> parameters, Literal fallback); }
InterpolateFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } InterpolateFunction();  InterpolateFunction(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(); }
InterpolateFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } InterpolateFunction();  InterpolateFunction(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 MODE_LINEAR; static final String MODE_COSINE; static final String MODE_CUBIC; static final String METHOD_NUMERIC; static final String METHOD_COLOR; static final String RASTER_DATA; static final FunctionName NAME; }