|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcsheets.core.CellImpl
public class CellImpl
The implementation of the Cell interface.
| Constructor Summary | |
|---|---|
CellImpl(Spreadsheet spreadsheet,
Address address)
Creates a new cell at the given address in the given spreadsheet. |
|
CellImpl(Spreadsheet spreadsheet,
Address address,
String content)
Creates a new cell at the given address in the given spreadsheet, initialized with the given content (not intended to be used directly). |
|
| Method Summary | |
|---|---|
void |
addCellListener(CellListener listener)
Registers the given listener on the cell. |
void |
clear()
Clears the content of the cell. |
int |
compareTo(Cell cell)
Compares this cell with the specified cell for order, by comparing their addresses. |
void |
copyFrom(Cell source)
Copies all data from the source cell to this one. |
Address |
getAddress()
Returns the address of the cell. |
CellListener[] |
getCellListeners()
Returns the listeners that have been registered on the cell. |
String |
getContent()
Returns the content of the cell, as entered by the user. |
SortedSet<Cell> |
getDependents()
Returns the dependents of the cell, i.e. the cells that contain a reference to the cell in their formula. |
Cell |
getExtension(String name)
Returns the extension with the given key. |
Formula |
getFormula()
Returns an expression representing the cell's formula. |
SortedSet<Cell> |
getPrecedents()
Returns the precedents of the cell, i.e. the cells that the formula in the cell references. |
Spreadsheet |
getSpreadsheet()
Returns the spreadsheet to which the cell belongs. |
Value |
getValue()
Returns the value of the cell. |
void |
moveFrom(Cell source)
Moves all data from the source cell to this one. |
void |
removeCellListener(CellListener listener)
Removes the given listener from the cell. |
void |
setContent(String content)
Sets the content of the cell and if it starts with the assignment operator attempts to parse a formula from it. |
String |
toString()
Returns a string representation of the cell. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
CellImpl(Spreadsheet spreadsheet,
Address address)
spreadsheet - the spreadsheetaddress - the address of the cellSpreadsheet.getCell(Address)
CellImpl(Spreadsheet spreadsheet,
Address address,
String content)
throws FormulaCompilationException
spreadsheet - the spreadsheetaddress - the address of the cellcontent - the content of the cell
ExpressionSyntaxException - if an incorrectly formatted formula was entered
FormulaCompilationExceptionSpreadsheet.getCell(Address)| Method Detail |
|---|
public Spreadsheet getSpreadsheet()
Cell
getSpreadsheet in interface Cellpublic Address getAddress()
Cell
getAddress in interface Cellpublic Value getValue()
Cell
getValue in interface Cellpublic String getContent()
Cell
getContent in interface Cellpublic Formula getFormula()
Cell
getFormula in interface Cellpublic void clear()
Cell
clear in interface Cell
public void setContent(String content)
throws FormulaCompilationException
Cell
setContent in interface CellFormulaCompilationException - if an incorrectly formatted formula was enteredpublic SortedSet<Cell> getPrecedents()
Cell
getPrecedents in interface Cellpublic SortedSet<Cell> getDependents()
Cell
getDependents in interface Cellpublic void copyFrom(Cell source)
Cell
copyFrom in interface Cellsource - the cell from which data should be copiedpublic void moveFrom(Cell source)
Cell
moveFrom in interface Cellsource - the cell from which data should be movedpublic void addCellListener(CellListener listener)
Cell
addCellListener in interface Celllistener - the listener to be addedpublic void removeCellListener(CellListener listener)
Cell
removeCellListener in interface Celllistener - the listener to be removedpublic CellListener[] getCellListeners()
Cell
getCellListeners in interface Cellpublic Cell getExtension(String name)
Extensible
getExtension in interface Extensible<Cell>name - the name of the extension (case-insensitive)
public int compareTo(Cell cell)
compareTo in interface Comparable<Cell>cell - the cell to be compared
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||