public class ArithmaticExpression extends ExpressionBase
Constructor and Description |
---|
ArithmaticExpression()
Ctor.
|
ArithmaticExpression(Expression left,
java.lang.String operator,
Expression right)
Ctor.
|
ArithmaticExpression(java.lang.String operator)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
ArithmaticExpression |
add(Expression expression)
Add an expression to include in the computation.
|
ArithmaticExpression |
add(java.lang.Object object)
Add a constant to include in the computation.
|
ArithmaticExpression |
add(java.lang.String propertyName)
Add a property to include in the computation.
|
java.lang.String |
getOperator()
Returns the arithmatic operator.
|
ExpressionPrecedenceEnum |
getPrecedence()
Returns precedence.
|
void |
setOperator(java.lang.String operator)
Set operator
|
void |
toPrecedenceFreeEPL(java.io.StringWriter writer)
Renders the expressions and all it's child expression, in full tree depth, as a string in
language syntax.
|
addChild, getChildren, getTreeObjectName, renderAggregation, setChildren, setTreeObjectName, toEPL, toPrecedenceFreeEPL, toPrecedenceFreeEPL
public ArithmaticExpression()
public ArithmaticExpression(java.lang.String operator)
operator
- can be any of '-', '+', '*', '/' or '%' (modulo).public ArithmaticExpression(Expression left, java.lang.String operator, Expression right)
left
- the left hand sideoperator
- can be any of '-', '+', '*', '/' or '%' (modulo).right
- the right hand sidepublic java.lang.String getOperator()
public void setOperator(java.lang.String operator)
operator
- new valuepublic ArithmaticExpression add(java.lang.Object object)
object
- constant to addpublic ArithmaticExpression add(Expression expression)
expression
- to addpublic ArithmaticExpression add(java.lang.String propertyName)
propertyName
- is the name of the propertypublic ExpressionPrecedenceEnum getPrecedence()
Expression
public void toPrecedenceFreeEPL(java.io.StringWriter writer)
ExpressionBase
toPrecedenceFreeEPL
in class ExpressionBase
writer
- is the output to use