Class BinaryOperation
java.lang.Object
org.apache.sling.scripting.sightly.compiler.expression.nodes.BinaryOperation
- All Implemented Interfaces:
- ExpressionNode
A {code BinaryOperation} defines an expression where a binary operator is applied (e.g. "a AND b").
- 
Constructor SummaryConstructorsConstructorDescriptionBinaryOperation(BinaryOperator operator, ExpressionNode leftOperand, ExpressionNode rightOperand) Creates aBinaryOperation.BinaryOperation(BinaryOperator operator, ExpressionNode leftOperand, ExpressionNode rightOperand, Expression parentExpression) Creates aBinaryOperation.
- 
Method SummaryModifier and TypeMethodDescription<T> Taccept(NodeVisitor<T> visitor) Accept a visitor to process this node.Returns the left operand.Returns the operator of the operation.Returns the parent expression, if any.Returns the right operand.toString()withParentExpression(Expression parentExpression) Returns a copy of thisBinaryOperationthat contains information about the node's parent expression.
- 
Constructor Details- 
BinaryOperationpublic BinaryOperation(BinaryOperator operator, ExpressionNode leftOperand, ExpressionNode rightOperand) Creates aBinaryOperation.- Parameters:
- operator- the operator
- leftOperand- the left operand
- rightOperand- the right operand
 
- 
BinaryOperationpublic BinaryOperation(BinaryOperator operator, ExpressionNode leftOperand, ExpressionNode rightOperand, Expression parentExpression) Creates aBinaryOperation.- Parameters:
- operator- the operator
- leftOperand- the left operand
- rightOperand- the right operand
- parentExpression- the parent expression of this operation
 
 
- 
- 
Method Details- 
getOperatorReturns the operator of the operation.- Returns:
- the operator
 
- 
getLeftOperandReturns the left operand.- Returns:
- the left operand
 
- 
getRightOperandReturns the right operand.- Returns:
- the right operand.
 
- 
getParentExpressionReturns the parent expression, if any.- Returns:
- the parent expression or null
 
- 
withParentExpressionReturns a copy of thisBinaryOperationthat contains information about the node's parent expression.- Parameters:
- parentExpression- the parent expression
- Returns:
- a copy of the original BinaryOperation
 
- 
acceptDescription copied from interface:ExpressionNodeAccept a visitor to process this node.- Specified by:
- acceptin interface- ExpressionNode
- Type Parameters:
- T- the type of the visitor
- Parameters:
- visitor- The visitor
- Returns:
- the node after it has been evaluated by the visitor
 
- 
toString
 
-