public class AssertionArithmeticVisitor extends Object implements ExpressionVisitor
Constructor and Description |
---|
AssertionArithmeticVisitor()
Constructs a new AssertionArithmeticVisitor.
|
Modifier and Type | Method and Description |
---|---|
MultiInterval |
getResult(Expression expression)
Retrieve the result of the arithmetic calculations performed by this visitor.
|
Object |
visitBinaryOperation(BinaryOperation operation)
Visits the given binary expression.
|
Object |
visitFunctionCall(FunctionCall call)
Visits the given function call.
|
Object |
visitLiteral(Literal literal)
Visits the given literal.
|
Object |
visitReference(Reference reference)
Visits the given cell reference.
|
Object |
visitUnaryOperation(UnaryOperation operation)
Visits the given unary expression.
|
public AssertionArithmeticVisitor()
public MultiInterval getResult(Expression expression) throws AssertionArithmeticException, MathException
NOTE! This function should only be called after the visitor has been used to traverse some Expression tree (by calling Expression.accept() passing this visitor as an argument. Otherwise an exception will be thrown.
expression
- the expression from which theAssertionArithmeticException
- if no result has been calculated yet, or if
the calculations resulted in more than one result. (Indicates an error in the formula).MathException
public Object visitBinaryOperation(BinaryOperation operation) throws AssertionArithmeticException, MathException
ExpressionVisitor
visitBinaryOperation
in interface ExpressionVisitor
operation
- the operation to visitAssertionArithmeticException
MathException
public Object visitFunctionCall(FunctionCall call) throws AssertionArithmeticException
ExpressionVisitor
visitFunctionCall
in interface ExpressionVisitor
call
- the function call to visitAssertionArithmeticException
public Object visitLiteral(Literal literal) throws AssertionArithmeticException
ExpressionVisitor
visitLiteral
in interface ExpressionVisitor
literal
- the literal to visitAssertionArithmeticException
public Object visitReference(Reference reference) throws AssertionArithmeticException
ExpressionVisitor
visitReference
in interface ExpressionVisitor
reference
- the reference to visitAssertionArithmeticException
public Object visitUnaryOperation(UnaryOperation operation) throws AssertionArithmeticException
ExpressionVisitor
visitUnaryOperation
in interface ExpressionVisitor
operation
- the operation to visitAssertionArithmeticException