Class ArithmaticExpression
java.lang.Object
com.espertech.esper.common.client.soda.ExpressionBase
com.espertech.esper.common.client.soda.ArithmaticExpression
- All Implemented Interfaces:
Expression
,Serializable
Arithmatic expression for addition, subtraction, multiplication, division and modulo.
- See Also:
-
Constructor Summary
ConstructorDescriptionCtor.ArithmaticExpression
(Expression left, String operator, Expression right) Ctor.ArithmaticExpression
(String operator) Ctor. -
Method Summary
Modifier and TypeMethodDescriptionadd
(Expression expression) Add an expression to include in the computation.Add a constant to include in the computation.Add a property to include in the computation.Returns the arithmatic operator.Returns precedence.void
setOperator
(String operator) Set operatorvoid
toPrecedenceFreeEPL
(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.common.client.soda.ExpressionBase
addChild, getChildren, getTreeObjectName, renderAggregation, setChildren, setTreeObjectName, toEPL, toPrecedenceFreeEPL, toPrecedenceFreeEPL
-
Constructor Details
-
ArithmaticExpression
public ArithmaticExpression()Ctor. -
ArithmaticExpression
Ctor.- Parameters:
operator
- can be any of '-', '+', '*', '/' or '%' (modulo).
-
ArithmaticExpression
Ctor.- Parameters:
left
- the left hand sideoperator
- can be any of '-', '+', '*', '/' or '%' (modulo).right
- the right hand side
-
-
Method Details
-
getOperator
Returns the arithmatic operator.- Returns:
- operator
-
setOperator
Set operator- Parameters:
operator
- new value
-
add
Add a constant to include in the computation.- Parameters:
object
- constant to add- Returns:
- expression
-
add
Add an expression to include in the computation.- Parameters:
expression
- to add- Returns:
- expression
-
add
Add a property to include in the computation.- Parameters:
propertyName
- is the name of the property- Returns:
- expression
-
getPrecedence
Description copied from interface:Expression
Returns precedence.- Returns:
- precedence
-
toPrecedenceFreeEPL
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 classExpressionBase
- Parameters:
writer
- is the output to use
-