public class CellReference extends Object implements Reference
Constructor and Description |
---|
CellReference(Cell cell)
Creates a new cell reference to the given address.
|
CellReference(Cell cell,
boolean columnAbsolute,
boolean rowAbsolute)
Creates a new cell reference to the given address, using the given
reference mode.
|
CellReference(Spreadsheet spreadsheet,
String reference)
Creates a new cell reference from a string matching the (@link #PATTERN).
|
Modifier and Type | Method and Description |
---|---|
Object |
accept(ExpressionVisitor visitor)
Accepts to visit the given expression visitor.
|
int |
compareTo(Reference reference)
Compares the cell reference with the given cell reference for order.
|
Value |
evaluate()
Evaluates the expression and returns the result.
|
Cell |
getCell()
Returns the cell to which the reference points.
|
SortedSet<Cell> |
getCells()
Returns the cell addresses (or address) that the reference points to.
|
boolean |
isColumnAbsolute()
Returns whether the column is denoted with an absolute reference.
|
boolean |
isRowAbsolute()
Returns whether the row is denoted with an absolute reference.
|
String |
toString()
Returns a string representation of the address of the cell reference
on the form "B22", composed of the letter of the column and number of
the row that intersect to form the address.
|
public CellReference(Cell cell)
cell
- the cell to which the reference pointspublic CellReference(Cell cell, boolean columnAbsolute, boolean rowAbsolute)
cell
- the cell to which the reference pointscolumnAbsolute
- if the column is denoted with an absolute referencerowAbsolute
- if the column is denoted with an absolute referencepublic CellReference(Spreadsheet spreadsheet, String reference) throws ParseException
spreadsheet
- the spreadsheet of the cellreference
- a string representation of the referenceParseException
- if the string did not match the patternpublic Value evaluate()
Expression
evaluate
in interface Expression
evaluate
in interface Reference
public Object accept(ExpressionVisitor visitor) throws ExpressionVisitorException
Expression
accept
in interface Expression
visitor
- the visitorExpressionVisitorException
public Cell getCell()
public SortedSet<Cell> getCells()
Reference
public boolean isColumnAbsolute()
public boolean isRowAbsolute()
public int compareTo(Reference reference)
compareTo
in interface Reference
compareTo
in interface Comparable<Reference>
reference
- the reference to be compared