com.espertech.esper.client.soda
Class ArithmaticExpression

java.lang.Object
  extended by com.espertech.esper.client.soda.ExpressionBase
      extended by com.espertech.esper.client.soda.ArithmaticExpression
All Implemented Interfaces:
Expression, Serializable

public class ArithmaticExpression
extends ExpressionBase

Arithmatic expression for addition, subtraction, multiplication, division and modulo.

See Also:
Serialized Form

Constructor Summary
ArithmaticExpression(Expression left, String operator, Expression right)
          Ctor.
ArithmaticExpression(String operator)
          Ctor.
 
Method Summary
 ArithmaticExpression add(Expression expression)
          Add an expression to include in the computation.
 ArithmaticExpression add(Object object)
          Add a constant to include in the computation.
 ArithmaticExpression add(String propertyName)
          Add a property to include in the computation.
 String getOperator()
          Returns the arithmatic operator.
 void toEPL(StringWriter writer)
          Renders the expressions and all it's child expression, in full tree depth, as a string in language syntax.
 
Methods inherited from class com.espertech.esper.client.soda.ExpressionBase
addChild, getChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArithmaticExpression

public ArithmaticExpression(String operator)
Ctor.

Parameters:
operator - can be any of '-', '+', '*', '/' or '%' (modulo).

ArithmaticExpression

public ArithmaticExpression(Expression left,
                            String operator,
                            Expression right)
Ctor.

Parameters:
left - the left hand side
operator - can be any of '-', '+', '*', '/' or '%' (modulo).
right - the right hand side
Method Detail

getOperator

public String getOperator()
Returns the arithmatic operator.

Returns:
operator

add

public ArithmaticExpression add(Object object)
Add a constant to include in the computation.

Parameters:
object - constant to add
Returns:
expression

add

public ArithmaticExpression add(Expression expression)
Add an expression to include in the computation.

Parameters:
expression - to add
Returns:
expression

add

public ArithmaticExpression add(String propertyName)
Add a property to include in the computation.

Parameters:
propertyName - is the name of the property
Returns:
expression

toEPL

public void toEPL(StringWriter writer)
Description copied from interface: Expression
Renders the expressions and all it's child expression, in full tree depth, as a string in language syntax.

Parameters:
writer - is the output to use

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com