public Object evaluate(Object feature) { String arg0; String arg1; try { // attempt to get value and perform conversion arg0 = (String) getExpression(0).evaluate(feature, String.class); // extra // protection // for // strings } catch (Exception e) // probably a type error { throw new IllegalArgumentException( "Filter Function problem for function strEqualsIgnoreCase argument #0 - expected type String"); } try { // attempt to get value and perform conversion arg1 = (String) getExpression(1).evaluate(feature, String.class); // extra // protection // for // strings } catch (Exception e) // probably a type error { throw new IllegalArgumentException( "Filter Function problem for function strEqualsIgnoreCase argument #1 - expected type String"); } return new Boolean(StaticGeometry.strEqualsIgnoreCase(arg0, arg1)); }
public Object evaluate(Object feature) { int arg0; try { // attempt to get value and perform conversion arg0 = (getExpression(0).evaluate(feature, Integer.class)).intValue(); } catch (Exception e) // probably a type error { throw new IllegalArgumentException( "Filter Function problem for function int2ddouble argument #0 - expected type int"); } return new Double(StaticGeometry.int2ddouble(arg0)); }
/** * Calculate the Geometry's minimum bounding circle. * * @param feature The feature should be a Geometry * @return The minimum bounding circle Geometry * @throws IllegalArgumentException if the feature is not a Geometry */ public Object evaluate(Object feature) { Geometry arg0; // attempt to get value and perform conversion try { arg0 = (Geometry) getExpression(0).evaluate(feature); } catch (Exception e) { // probably a type error throw new IllegalArgumentException( "Filter Function problem for function minimum bounding circle argument #0 - expected type Geometry"); } return (StaticGeometry.minimumCircle(arg0)); }
@Override public Object evaluate(final Object feature) { Geometry arg0; try { // attempt to get value and perform conversion arg0 = (Geometry) parameters.get(0).evaluate(feature); } catch (Exception e) // probably a type error { throw new IllegalArgumentException( "Filter Function problem for function interiorPoint argument #0 - expected type Geometry"); } return (StaticGeometry.interiorPoint(arg0)); }
public Object evaluate(Object feature) { String arg0; try { // attempt to get value and perform conversion arg0 = getExpression(0).evaluate(feature, String.class); // extra // protection // for // strings } catch (Exception e) // probably a type error { throw new IllegalArgumentException( "Filter Function problem for function parseInt argument #0 - expected type String"); } return new Integer(StaticGeometry.parseInt(arg0)); }
public Object evaluate(Object feature) { Object arg0; Object arg1; Object arg2; Object arg3; try { // attempt to get value and perform conversion arg0 = (Object) getExpression(0).evaluate(feature); } catch (Exception e) // probably a type error { throw new IllegalArgumentException( "Filter Function problem for function in3 argument #0 - expected type Object"); } try { // attempt to get value and perform conversion arg1 = (Object) getExpression(1).evaluate(feature); } catch (Exception e) // probably a type error { throw new IllegalArgumentException( "Filter Function problem for function in3 argument #1 - expected type Object"); } try { // attempt to get value and perform conversion arg2 = (Object) getExpression(2).evaluate(feature); } catch (Exception e) // probably a type error { throw new IllegalArgumentException( "Filter Function problem for function in3 argument #2 - expected type Object"); } try { // attempt to get value and perform conversion arg3 = (Object) getExpression(3).evaluate(feature); } catch (Exception e) // probably a type error { throw new IllegalArgumentException( "Filter Function problem for function in3 argument #3 - expected type Object"); } return new Boolean(StaticGeometry.in3(arg0, arg1, arg2, arg3)); }