@Test public void testEvaluateIEvent3() { MethodExpression methodExpression = new MethodExpression(new StringConcat(null), "evaluate", new IExpression[] {new ConstExpression("a"), new ConstExpression("b")}); String res = (String)methodExpression.evaluate(new TupleEvent()); Assert.assertEquals(res, "ab"); }
@Override public Object evaluate(IEvent theEvent) { if (null == fastMethod) { resolveMethod(expr); } if (null == theEvent) { throw new RuntimeException("theEvent is null."); } Object[] resultTemp = null; if (expr != null) { resultTemp = new Object[expr.length]; for (int i = 0; i < expr.length; i++) { resultTemp[i] = expr[i].evaluate(theEvent); } } try { return fastMethod.invoke(obj, resultTemp); } catch (InvocationTargetException e) { LOG.error("Invoke method caught exception.", e); throw new RuntimeException(e); } }
MethodExpression implements IExpression { @Override public Object evaluate(IEvent theEvent) { if (null == fastMethod) { resolveMethod(expr); } if (null == theEvent) { throw new RuntimeException("theEvent is null."); } Object[] resultTemp = null; if (expr != null) { resultTemp = new Object[expr.length]; for (int i = 0; i < expr.length; i++) { resultTemp[i] = expr[i].evaluate(theEvent); } } try { return fastMethod.invoke(obj, resultTemp); } catch (InvocationTargetException e) { LOG.error("Invoke method caught exception.", e); throw new RuntimeException(e); } } }
MethodExpression implements IExpression { @Override public Object evaluate(IEvent theEvent) { if (null == fastMethod) { resolveMethod(expr); } if (null == theEvent) { throw new RuntimeException("theEvent is null."); } Object[] resultTemp = null; if (expr != null) { resultTemp = new Object[expr.length]; for (int i = 0; i < expr.length; i++) { resultTemp[i] = expr[i].evaluate(theEvent); } } try { return fastMethod.invoke(obj, resultTemp); } catch (InvocationTargetException e) { LOG.error("Invoke method caught exception.", e); throw new RuntimeException(e); } } MethodExpression(Class< ? > declareClass, String methodName, IExpression[] expr);  MethodExpression(Object object, String methodName, IExpression[] expr); }
MethodExpression implements IExpression { @Override public Object evaluate(IEvent theEvent) { if (null == fastMethod) { resolveMethod(expr); } if (null == theEvent) { throw new RuntimeException("theEvent is null."); } Object[] resultTemp = null; if (expr != null) { resultTemp = new Object[expr.length]; for (int i = 0; i < expr.length; i++) { resultTemp[i] = expr[i].evaluate(theEvent); } } try { return fastMethod.invoke(obj, resultTemp); } catch (InvocationTargetException e) { LOG.error("Invoke method caught exception.", e); throw new RuntimeException(e); } } MethodExpression(Class< ? > declareClass, String methodName, IExpression[] expr);  MethodExpression(Object object, String methodName, IExpression[] expr); @Override Object evaluate(IEvent theEvent); Object evaluate(IEvent[] eventsPerStream); @Override Class< ? > getType(); IExpression[] getExpr(); }
MethodExpression implements IExpression { @Override public Object evaluate(IEvent theEvent) { if (null == fastMethod) { resolveMethod(expr); } if (null == theEvent) { throw new RuntimeException("theEvent is null."); } Object[] resultTemp = null; if (expr != null) { resultTemp = new Object[expr.length]; for (int i = 0; i < expr.length; i++) { resultTemp[i] = expr[i].evaluate(theEvent); } } try { return fastMethod.invoke(obj, resultTemp); } catch (InvocationTargetException e) { LOG.error("Invoke method caught exception.", e); throw new RuntimeException(e); } } MethodExpression(Class< ? > declareClass, String methodName, IExpression[] expr);  MethodExpression(Object object, String methodName, IExpression[] expr); @Override Object evaluate(IEvent theEvent); Object evaluate(IEvent[] eventsPerStream); @Override Class< ? > getType(); IExpression[] getExpr();  }