csheets.core.formula.util
Class ReferenceTransposer
java.lang.Object
csheets.core.formula.util.ExpressionBuilder
csheets.core.formula.util.ReferenceTransposer
- All Implemented Interfaces:
- ExpressionVisitor
public class ReferenceTransposer
- extends ExpressionBuilder
An expression visitor that transposes the references in an expression.
The visitor is used for copying and moving formulas between cells.
- Author:
- Einar Pehrson
|
Constructor Summary |
ReferenceTransposer(int columns,
int rows)
Creates a new reference fetcher. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReferenceTransposer
public ReferenceTransposer(int columns,
int rows)
- Creates a new reference fetcher.
- Parameters:
columns - the number of columns to transpose formulaerows - the number of rows to transpose formulae
getExpression
public Expression getExpression(Expression expression)
- Returns a transposed copy of the given expression.
- Overrides:
getExpression in class ExpressionBuilder
- Parameters:
expression - the expression to rebuild
- Returns:
- the transposed expression
visitReference
public Expression visitReference(Reference reference)
- Transposes the reference.
- Specified by:
visitReference in interface ExpressionVisitor- Overrides:
visitReference in class ExpressionBuilder
- Parameters:
reference - the reference to visit
- Returns:
- an arbitrary object