public class ArithmaticExpression extends ExpressionBase
Constructor and Description |
---|
ArithmaticExpression()
Ctor.
|
ArithmaticExpression(Expression left,
String operator,
Expression right)
Ctor.
|
ArithmaticExpression(String operator)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
ExpressionPrecedenceEnum |
getPrecedence()
Returns precedence.
|
void |
setOperator(String operator)
Set operator
|
void |
toPrecedenceFreeEPL(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(String operator)
operator
- can be any of '-', '+', '*', '/' or '%' (modulo).public ArithmaticExpression(Expression left, String operator, Expression right)
left
- the left hand sideoperator
- can be any of '-', '+', '*', '/' or '%' (modulo).right
- the right hand sidepublic String getOperator()
public void setOperator(String operator)
operator
- new valuepublic ArithmaticExpression add(Object object)
object
- constant to addpublic ArithmaticExpression add(Expression expression)
expression
- to addpublic ArithmaticExpression add(String propertyName)
propertyName
- is the name of the propertypublic ExpressionPrecedenceEnum getPrecedence()
Expression
public void toPrecedenceFreeEPL(StringWriter writer)
ExpressionBase
toPrecedenceFreeEPL
in class ExpressionBase
writer
- is the output to use