csheets.core
Interface Spreadsheet

All Superinterfaces:
Extensible<Spreadsheet>, Iterable<Cell>, Serializable
All Known Implementing Classes:
SpreadsheetExtension, SpreadsheetImpl, StylableSpreadsheet, TestableSpreadsheet

public interface Spreadsheet
extends Iterable<Cell>, Extensible<Spreadsheet>, Serializable

A spreadsheet which provides cell data and dependencies.

Author:
Einar Pehrson

Method Summary
 void addCellListener(CellListener listener)
          Registers the given listener to receive events from all cells in the spreadsheet.
 Cell getCell(Address address)
          Returns the cell at the given address.
 Cell getCell(int column, int row)
          Returns the cell at the given column and row in the spreadsheet.
 CellListener[] getCellListeners()
          Returns the cell listeners that have been registered on the spreadsheet.
 SortedSet<Cell> getCells(Address address1, Address address2)
          Returns the cells in the range between the given addresses.
 Cell[] getColumn(int index)
          Returns the cells in the given column.
 int getColumnCount()
          Returns the number of columns in the spreadsheet.
 Cell[] getRow(int index)
          Returns the cells in the given row.
 int getRowCount()
          Returns the number of rows in the spreadsheet.
 String getTitle()
          Returns the title of the spreadsheet.
 Workbook getWorkbook()
          Returns the workbook to which the spreadsheet belongs.
 void removeCellListener(CellListener listener)
          Deregisters the given listener from receiving events from all cells in the spreadsheet.
 void setTitle(String title)
          Sets the title of the spreadsheet.
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface csheets.ext.Extensible
getExtension
 

Method Detail

getWorkbook

Workbook getWorkbook()
Returns the workbook to which the spreadsheet belongs.

Returns:
the workbook to which the spreadsheet belongs

getTitle

String getTitle()
Returns the title of the spreadsheet.

Returns:
the title of the spreadsheet.

setTitle

void setTitle(String title)
Sets the title of the spreadsheet.

Parameters:
title - the title of the spreadsheet.

getColumnCount

int getColumnCount()
Returns the number of columns in the spreadsheet.

Returns:
the number of columns in the spreadsheet.

getRowCount

int getRowCount()
Returns the number of rows in the spreadsheet.

Returns:
the number of rows in the spreadsheet.

getCell

Cell getCell(Address address)
Returns the cell at the given address.

Parameters:
address - the address of the cell
Returns:
the cell at the given address

getCell

Cell getCell(int column,
             int row)
Returns the cell at the given column and row in the spreadsheet.

Parameters:
column - the column index of the cell's location
row - the row index of the cell's location
Returns:
the cell at the given column and row in the spreadsheet

getCells

SortedSet<Cell> getCells(Address address1,
                         Address address2)
Returns the cells in the range between the given addresses.

Parameters:
address1 - the address of the cell in one end of the range
address2 - the address of the cell in the other end of the range
Returns:
a sorted set of the cells in the range

getColumn

Cell[] getColumn(int index)
Returns the cells in the given column.

Parameters:
index - the index of the column
Returns:
an array of the cells in the column

getRow

Cell[] getRow(int index)
Returns the cells in the given row.

Parameters:
index - the index of the row
Returns:
an array of the cells in the row

addCellListener

void addCellListener(CellListener listener)
Registers the given listener to receive events from all cells in the spreadsheet.

Parameters:
listener - the listener to be added

removeCellListener

void removeCellListener(CellListener listener)
Deregisters the given listener from receiving events from all cells in the spreadsheet.

Parameters:
listener - the listener to be removed

getCellListeners

CellListener[] getCellListeners()
Returns the cell listeners that have been registered on the spreadsheet.

Returns:
the cell listeners that have been registered on the spreadsheet