Class ArithmaticExpression

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

public class ArithmaticExpression extends ExpressionBase
Arithmatic expression for addition, subtraction, multiplication, division and modulo.
See Also:
  • Constructor Details

    • ArithmaticExpression

      public ArithmaticExpression()
      Ctor.
    • 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 Details

    • getOperator

      public String getOperator()
      Returns the arithmatic operator.
      Returns:
      operator
    • setOperator

      public void setOperator(String operator)
      Set operator
      Parameters:
      operator - new value
    • 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
    • getPrecedence

      public ExpressionPrecedenceEnum getPrecedence()
      Description copied from interface: Expression
      Returns precedence.
      Returns:
      precedence
    • toPrecedenceFreeEPL

      public void toPrecedenceFreeEPL(StringWriter writer)
      Description copied from class: ExpressionBase
      Renders the expressions and all it's child expression, in full tree depth, as a string in language syntax.
      Specified by:
      toPrecedenceFreeEPL in class ExpressionBase
      Parameters:
      writer - is the output to use