csheets.core.formula.util
Class CircularReferenceFinder
java.lang.Object
csheets.core.formula.util.AbstractExpressionVisitor
csheets.core.formula.util.CircularReferenceFinder
- All Implemented Interfaces:
- ExpressionVisitor
public class CircularReferenceFinder
- extends AbstractExpressionVisitor
An expression visitor that looks for circular references in a formula, i.e.
a reference back to the cell in the formula of a cell that precedes it.
- Author:
- Einar Pehrson
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CircularReferenceFinder
public CircularReferenceFinder()
- Creates a new circular reference finder.
check
public void check(Formula formula)
throws CircularReferenceException
- Checks if the given formula has any circular references.
- Throws:
CircularReferenceException - if the formula contains any circular references
visitReference
public Object visitReference(Reference reference)
throws CircularReferenceException,
ExpressionVisitorException
- Checks if the given reference causes a circular reference.
- Specified by:
visitReference in interface ExpressionVisitor- Overrides:
visitReference in class AbstractExpressionVisitor
- Parameters:
reference - the reference to visit
- Returns:
- an arbitrary object
- Throws:
CircularReferenceException - if the given reference causes a circular reference
ExpressionVisitorException