csheets.core.formula.util
Class AbstractExpressionVisitor

java.lang.Object
  extended by csheets.core.formula.util.AbstractExpressionVisitor
All Implemented Interfaces:
ExpressionVisitor
Direct Known Subclasses:
CircularReferenceFinder, ExpressionTreePrinter, ReferenceFetcher

public abstract class AbstractExpressionVisitor
extends Object
implements ExpressionVisitor

A default implementation of an expression visitor, that simply visits all the nodes in the tree. All methods return the expression that was visited.

Author:
Einar Pehrson

Constructor Summary
AbstractExpressionVisitor()
          Creates a new expression visitor.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractExpressionVisitor

public AbstractExpressionVisitor()
Creates a new expression visitor.

Method Detail

visitLiteral

public Object visitLiteral(Literal literal)
Description copied from interface: ExpressionVisitor
Visits the given literal.

Specified by:
visitLiteral in interface ExpressionVisitor
Parameters:
literal - the literal to visit
Returns:
an arbitrary object

visitUnaryOperation

public Object visitUnaryOperation(UnaryOperation operation)
Description copied from interface: ExpressionVisitor
Visits the given unary expression.

Specified by:
visitUnaryOperation in interface ExpressionVisitor
Parameters:
operation - the operation to visit
Returns:
an arbitrary object

visitBinaryOperation

public Object visitBinaryOperation(BinaryOperation operation)
Description copied from interface: ExpressionVisitor
Visits the given binary expression.

Specified by:
visitBinaryOperation in interface ExpressionVisitor
Parameters:
operation - the operation to visit
Returns:
an arbitrary object

visitReference

public Object visitReference(Reference reference)
Description copied from interface: ExpressionVisitor
Visits the given cell reference.

Specified by:
visitReference in interface ExpressionVisitor
Parameters:
reference - the reference to visit
Returns:
an arbitrary object

visitFunctionCall

public Object visitFunctionCall(FunctionCall call)
Description copied from interface: ExpressionVisitor
Visits the given function call.

Specified by:
visitFunctionCall in interface ExpressionVisitor
Parameters:
call - the function call to visit
Returns:
an arbitrary object