public class ReferenceOperation extends BinaryOperation implements Reference
Constructor and Description |
---|
ReferenceOperation(Reference leftOperand,
RangeReference operator,
Reference rightOperand)
Creates a new reference operation.
|
Modifier and Type | Method and Description |
---|---|
Object |
accept(ExpressionVisitor visitor)
Accepts to visit the given expression visitor.
|
int |
compareTo(Reference reference)
Compares the reference with the given reference for order.
|
Value |
evaluate()
Evaluates the expression and returns the result.
|
SortedSet<Cell> |
getCells()
Returns the cell addresses (or address) that the reference points to.
|
Reference |
getLeftOperand()
Returns the left(first) operand.
|
RangeReference |
getOperator()
Returns the operator.
|
Reference |
getRightOperand()
Returns the right(second) operand.
|
toString
public ReferenceOperation(Reference leftOperand, RangeReference operator, Reference rightOperand)
leftOperand
- the left(first) operandoperator
- the reference operatorrightOperand
- the right(second) operandpublic SortedSet<Cell> getCells()
Reference
public RangeReference getOperator()
Operation
getOperator
in class Operation<BinaryOperator>
public Reference getLeftOperand()
BinaryOperation
getLeftOperand
in class BinaryOperation
public Reference getRightOperand()
BinaryOperation
getRightOperand
in class BinaryOperation
public Value evaluate()
Expression
evaluate
in interface Expression
evaluate
in interface Reference
evaluate
in class BinaryOperation
public Object accept(ExpressionVisitor visitor) throws ExpressionVisitorException
Expression
accept
in interface Expression
accept
in class BinaryOperation
visitor
- the visitorExpressionVisitorException
public int compareTo(Reference reference)
Reference
compareTo
in interface Reference
compareTo
in interface Comparable<Reference>
reference
- the reference to be compared