@Test public void testEvaluate3() throws StreamingException { ArithmeticExpression arithmeticExpression = new ArithmeticExpression(ExpressionOperator.MULTIPLY, new ConstExpression(SupportConst.I_TWO), new ConstExpression(SupportConst.I_THREE)); IEvent theEvent = new TupleEvent(); Object actualResult = arithmeticExpression.evaluate(theEvent); int expectedResult = SupportConst.I_SIX; Assert.assertEquals(expectedResult, actualResult); }
@Override public Object evaluate(IEvent theEvent) { if (null == theEvent) { throw new StreamingRuntimeException("IEvent is null!"); } IExpression leftExpr = getLeftExpr(); IExpression rightExpr = getRightExpr(); Object lo = leftExpr.evaluate(theEvent); Object ro = rightExpr.evaluate(theEvent); return compute(lo, ro); }
ArithmeticExpression extends OperatorBasedExpression { @Override public Object evaluate(IEvent theEvent) { if (null == theEvent) { throw new StreamingRuntimeException("IEvent is null!"); } IExpression leftExpr = getLeftExpr(); IExpression rightExpr = getRightExpr(); Object lo = leftExpr.evaluate(theEvent); Object ro = rightExpr.evaluate(theEvent); return compute(lo, ro); } }
ArithmeticExpression extends OperatorBasedExpression { @Override public Object evaluate(IEvent theEvent) { if (null == theEvent) { throw new StreamingRuntimeException("IEvent is null!"); } IExpression leftExpr = getLeftExpr(); IExpression rightExpr = getRightExpr(); Object lo = leftExpr.evaluate(theEvent); Object ro = rightExpr.evaluate(theEvent); return compute(lo, ro); } ArithmeticExpression(ExpressionOperator op, IExpression leftExpr, IExpression rightExpr); }
ArithmeticExpression extends OperatorBasedExpression { @Override public Object evaluate(IEvent theEvent) { if (null == theEvent) { throw new StreamingRuntimeException("IEvent is null!"); } IExpression leftExpr = getLeftExpr(); IExpression rightExpr = getRightExpr(); Object lo = leftExpr.evaluate(theEvent); Object ro = rightExpr.evaluate(theEvent); return compute(lo, ro); } ArithmeticExpression(ExpressionOperator op, IExpression leftExpr, IExpression rightExpr); @Override Object evaluate(IEvent theEvent); @Override Object evaluate(IEvent[] eventsPerStream); void setType(Class< ? > type); Class< ? > validateType(); }
ArithmeticExpression extends OperatorBasedExpression { @Override public Object evaluate(IEvent theEvent) { if (null == theEvent) { throw new StreamingRuntimeException("IEvent is null!"); } IExpression leftExpr = getLeftExpr(); IExpression rightExpr = getRightExpr(); Object lo = leftExpr.evaluate(theEvent); Object ro = rightExpr.evaluate(theEvent); return compute(lo, ro); } ArithmeticExpression(ExpressionOperator op, IExpression leftExpr, IExpression rightExpr); @Override Object evaluate(IEvent theEvent); @Override Object evaluate(IEvent[] eventsPerStream); void setType(Class< ? > type); Class< ? > validateType();  }