@Test public void testEvaluateInteger() { MethodExpression methodExpression = new MethodExpression(new Abs(null), "evaluate", new IExpression[] {new ConstExpression(-1)}); Integer value = (Integer)methodExpression.evaluate(new TupleEvent()); assertTrue(value.equals(1)); }
public Integer evaluate(Integer number) { if (number == null) { return null; } return Math.abs(number); }
Abs extends UDF { public Integer evaluate(Integer number) { if (number == null) { return null; } return Math.abs(number); } }
Abs extends UDF { public Integer evaluate(Integer number) { if (number == null) { return null; } return Math.abs(number); } Abs(Map<String, String> config); }
Abs extends UDF { public Integer evaluate(Integer number) { if (number == null) { return null; } return Math.abs(number); } Abs(Map<String, String> config); Integer evaluate(Integer number); Long evaluate(Long number); Float evaluate(Float number); Double evaluate(Double number); BigDecimal evaluate(BigDecimal number); }
Abs extends UDF { public Integer evaluate(Integer number) { if (number == null) { return null; } return Math.abs(number); } Abs(Map<String, String> config); Integer evaluate(Integer number); Long evaluate(Long number); Float evaluate(Float number); Double evaluate(Double number); BigDecimal evaluate(BigDecimal number);  }