csheets.core.formula.util
Class ReferenceFetcher
java.lang.Object
csheets.core.formula.util.AbstractExpressionVisitor
csheets.core.formula.util.ReferenceFetcher
- All Implemented Interfaces:
- ExpressionVisitor
public class ReferenceFetcher
- extends AbstractExpressionVisitor
An expression visitor that collects the references from an expression.
- Author:
- Einar Pehrson
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReferenceFetcher
public ReferenceFetcher()
- Creates a new reference fetcher.
getReferences
public SortedSet<Reference> getReferences(Expression expression)
- Traverses the given expression and returns the references that were found.
- Parameters:
expression - the expression from which to fetch references
- Returns:
- the references that have been fetched
visitReference
public Object visitReference(Reference reference)
- Adds the reference to the set.
- Specified by:
visitReference in interface ExpressionVisitor- Overrides:
visitReference in class AbstractExpressionVisitor
- Parameters:
reference - the reference to visit
- Returns:
- an arbitrary object