public Object evaluate(Object feature) { double arg0; double arg1; try { // attempt to get value and perform conversion arg0 = (getExpression(0).evaluate(feature, Double.class)).doubleValue(); } catch (Exception e) { // probably a type error throw new IllegalArgumentException( "Filter Function problem for function atan2 argument #0 - expected type double"); } try { // attempt to get value and perform conversion arg1 = (getExpression(1).evaluate(feature, Double.class)).doubleValue(); } catch (Exception e) { // probably a type error throw new IllegalArgumentException( "Filter Function problem for function atan2 argument #1 - expected type double"); } return new Double(Math.atan2(arg0, arg1)); } }
org.opengis.filter.expression.Expression.NIL, org.opengis.filter.expression.Expression.NIL); assertEquals("Name is, ", "atan2", atan2.getName()); assertEquals("Number of arguments, ", 2, atan2.getFunctionName().getArgumentCount());
public Object evaluate(Object feature) { double arg0; double arg1; try { // attempt to get value and perform conversion arg0 = ((Number) getExpression(0).evaluate(feature)).doubleValue(); } catch (Exception e) { // probably a type error throw new IllegalArgumentException( "Filter Function problem for function atan2 argument #0 - expected type double"); } try { // attempt to get value and perform conversion arg1 = ((Number) getExpression(1).evaluate(feature)).doubleValue(); } catch (Exception e) { // probably a type error throw new IllegalArgumentException( "Filter Function problem for function atan2 argument #1 - expected type double"); } return new Double(Math.atan2(arg0, arg1)); } }
public Object evaluate(Object feature) { double arg0; double arg1; try { // attempt to get value and perform conversion arg0 = (getExpression(0).evaluate(feature,Double.class)).doubleValue(); } catch (Exception e) { // probably a type error throw new IllegalArgumentException( "Filter Function problem for function atan2 argument #0 - expected type double"); } try { // attempt to get value and perform conversion arg1 = (getExpression(1).evaluate(feature,Double.class)).doubleValue(); } catch (Exception e) { // probably a type error throw new IllegalArgumentException( "Filter Function problem for function atan2 argument #1 - expected type double"); } return new Double(Math.atan2(arg0, arg1)); } }