public final class BinaryOperation extends Object implements ExpressionNode
Constructor and Description |
---|
BinaryOperation(BinaryOperator operator,
ExpressionNode leftOperand,
ExpressionNode rightOperand)
Creates a
BinaryOperation . |
BinaryOperation(BinaryOperator operator,
ExpressionNode leftOperand,
ExpressionNode rightOperand,
Expression parentExpression)
Creates a
BinaryOperation . |
Modifier and Type | Method and Description |
---|---|
<T> T |
accept(NodeVisitor<T> visitor)
Accept a visitor to process this node.
|
ExpressionNode |
getLeftOperand()
Returns the left operand.
|
BinaryOperator |
getOperator()
Returns the operator of the operation.
|
Expression |
getParentExpression()
Returns the parent expression, if any.
|
ExpressionNode |
getRightOperand()
Returns the right operand.
|
String |
toString() |
BinaryOperation |
withParentExpression(Expression parentExpression)
Returns a copy of this
BinaryOperation that contains information about the node's parent expression. |
public BinaryOperation(BinaryOperator operator, ExpressionNode leftOperand, ExpressionNode rightOperand)
BinaryOperation
.operator
- the operatorleftOperand
- the left operandrightOperand
- the right operandpublic BinaryOperation(BinaryOperator operator, ExpressionNode leftOperand, ExpressionNode rightOperand, Expression parentExpression)
BinaryOperation
.operator
- the operatorleftOperand
- the left operandrightOperand
- the right operandparentExpression
- the parent expression of this operationpublic BinaryOperator getOperator()
public ExpressionNode getLeftOperand()
public ExpressionNode getRightOperand()
public Expression getParentExpression()
null
public BinaryOperation withParentExpression(Expression parentExpression)
BinaryOperation
that contains information about the node's parent expression.parentExpression
- the parent expressionBinaryOperation
public <T> T accept(NodeVisitor<T> visitor)
ExpressionNode
accept
in interface ExpressionNode
T
- the type of the visitorvisitor
- The visitorCopyright © 2017 The Apache Software Foundation. All rights reserved.