xelem.3.0

nl.fountain.xelem.excel
Interface Table

All Superinterfaces:
XLElement
All Known Implementing Classes:
SSTable

public interface Table
extends XLElement

Represents the Table element.


Field Summary
 
Fields inherited from interface nl.fountain.xelem.excel.XLElement
PREFIX_HTML, PREFIX_O, PREFIX_SS, PREFIX_X, XMLNS, XMLNS_HTML, XMLNS_O, XMLNS_SS, XMLNS_X
 
Method Summary
 Column addColumn()
          Adds a new Column to this table.
 Column addColumn(Column column)
          Adds the given column to this table.
 Column addColumnAt(int index)
          Adds a new Column at the given index to this table.
 Column addColumnAt(int index, Column column)
          Adds the given Column at the given index to this table.
 Row addRow()
          Adds a new Row to this table.
 Row addRow(Row row)
          Adds the given row to this table.
 Row addRowAt(int index)
          Adds a new Row at the given index to this table.
 Row addRowAt(int index, Row row)
          Adds the given Row at the given index to this table.
 int columnCount()
          Returns the number of columns in this table.
 Iterator<Column> columnIterator()
          Returns an iterator for the columns in this table.
 Column getColumnAt(int index)
          Gets the column at the given index.
 Collection<Column> getColumns()
          Gets all the columns of this table in the order of their index.
 int getExpandedColumnCount()
          An indicator of the index of the right-most column on this table.
 int getExpandedRowCount()
          An indicator of the index of the bottom row on this table.
 Row getRowAt(int index)
          Gets the row at the given index.
 TreeMap<Integer,Row> getRowMap()
          Gets all the rows of this table.
 Collection<Row> getRows()
          Gets all the rows of this table in the order of their index.
 String getStyleID()
          Gets the ss:StyleID which was set on this table.
 boolean hasChildren()
          Indicates whether this table has any rows or columns.
 boolean hasColumnAt(int index)
          Specifies whether this table has a column at the given index.
 boolean hasRowAt(int index)
          Specifies whether this table has a row at the given index.
 int maxCellIndex()
          Gets the highest index number of all the cells of all the rows in this table: the right-most cell.
 int maxColumnIndex()
          Gets the highest index number of the columns in this table.
 int maxRowIndex()
          Gets the highest index number of the rows in this table.
 Column removeColumnAt(int index)
          Removes the column at the given index.
 Row removeRowAt(int index)
          Removes the row at the given index.
 int rowCount()
          Returns the number of rows in this table.
 Iterator<Row> rowIterator()
          Returns an iterator for the rows in this table.
 void setDefaultColumnWidth(double points)
          Sets the default column width.
 void setDefaultRowHeight(double points)
          Sets the default row height.
 void setStyleID(String id)
          Sets the ss:StyleID on this table.
 
Methods inherited from interface nl.fountain.xelem.excel.XLElement
addElementComment, assemble, getElementComments, getNameSpace, getPrefix, getTagName, setAttributes, setChildElement
 

Method Detail

setStyleID

void setStyleID(String id)
Sets the ss:StyleID on this table. If no styleID is set on a table, the ss:StyleID-attribute is not deployed in the resulting xml and Excel employes the Default-style on the table.

Parameters:
id - the id of the style to employ on this table.

getStyleID

String getStyleID()
Gets the ss:StyleID which was set on this table.

Returns:
The id of the style to employ on this table or null if no styleID was previously set.

setDefaultRowHeight

void setDefaultRowHeight(double points)
Sets the default row height.

Parameters:
points - The default row height.

setDefaultColumnWidth

void setDefaultColumnWidth(double points)
Sets the default column width.

Parameters:
points - The default column width.

addColumn

Column addColumn()
Adds a new Column to this table. If no columns were previously added the column will be added at index 1. Otherwise the column will be added at maxColumnIndex() + 1.

Returns:
A new column.
Throws:
IndexOutOfBoundsException - If the calculated index is less then Worksheet.firstColumn or greater then Worksheet.lastColumn.

addColumnAt

Column addColumnAt(int index)
Adds a new Column at the given index to this table. If the index was allready occupied by another column, replaces this column.

Parameters:
index - The index (column number) of the column.
Returns:
A new column.
Throws:
IndexOutOfBoundsException - If the calculated index is less then Worksheet.firstColumn or greater then Worksheet.lastColumn.

addColumn

Column addColumn(Column column)
Adds the given column to this table. If no columns were previously added the column will be added at index 1. Otherwise the ccolumn will be added at maxColumnIndex() + 1.

Parameters:
column - The column to be added.
Returns:
The passed column.
Throws:
IndexOutOfBoundsException - If the calculated index is less then Worksheet.firstColumn or greater then Worksheet.lastColumn.

addColumnAt

Column addColumnAt(int index,
                   Column column)
Adds the given Column at the given index to this table. If the index was allready occupied by another column, replaces this column.

Parameters:
index - The index (column number) of the column.
column - The column to be added.
Returns:
The passed column.
Throws:
IndexOutOfBoundsException - If the calculated index is less then Worksheet.firstColumn or greater then Worksheet.lastColumn.

removeColumnAt

Column removeColumnAt(int index)
Removes the column at the given index.

Parameters:
index - The index (column number) of the column.
Returns:
The removed column or null if the index was not occupied by a column.

getColumnAt

Column getColumnAt(int index)
Gets the column at the given index. If no column was at the given index, returns a new column.

Parameters:
index - The index (column number) of the column.
Returns:
The column at the given index. Never null.
Throws:
IndexOutOfBoundsException - If the calculated index is less then Worksheet.firstColumn or greater then Worksheet.lastColumn.

hasColumnAt

boolean hasColumnAt(int index)
Specifies whether this table has a column at the given index.


getColumns

Collection<Column> getColumns()
Gets all the columns of this table in the order of their index.

Returns:
A collection of columns.

columnIterator

Iterator<Column> columnIterator()
Returns an iterator for the columns in this table. Columns are aware of their index number when passed by this iterator.

Returns:
An iterator for the columns in this table.

addRow

Row addRow()
Adds a new Row to this table. If no rows were previously added the row will be added at index 1. Otherwise the row will be added at maxRowIndex() + 1.

Returns:
A new Row.
Throws:
IndexOutOfBoundsException - If the calculated index is less then Worksheet.firstRow or greater then Worksheet.lastRow.

addRowAt

Row addRowAt(int index)
Adds a new Row at the given index to this table. If the index was allready occupied by another row, replaces this row.

Parameters:
index - The index (row number) of the row.
Returns:
A new Row.
Throws:
IndexOutOfBoundsException - If the calculated index is less then Worksheet.firstRow or greater then Worksheet.lastRow.

addRow

Row addRow(Row row)
Adds the given row to this table. If no rows were previously added the row will be added at index 1. Otherwise the row will be added at maxRowIndex() + 1.

Parameters:
row - The row to be added.
Returns:
The passed row.
Throws:
IndexOutOfBoundsException - If the calculated index is less then Worksheet.firstRow or greater then Worksheet.lastRow.

addRowAt

Row addRowAt(int index,
             Row row)
Adds the given Row at the given index to this table. If the index was allready occupied by another row, replaces this row.

Parameters:
index - The index (row number) of the row.
row - The row to be added.
Returns:
The passed row.
Throws:
IndexOutOfBoundsException - If the calculated index is less then Worksheet.firstRow or greater then Worksheet.lastRow.

removeRowAt

Row removeRowAt(int index)
Removes the row at the given index.

Parameters:
index - The index (row number) of the row.
Returns:
The removed row or null if the index was not occupied by a row.

getRowAt

Row getRowAt(int index)
Gets the row at the given index. If no row was at the given index, returns a new row at that index.

Parameters:
index - The index (row number) of the row.
Returns:
The row at the given index. Never null
Throws:
IndexOutOfBoundsException - If the calculated index is less then Worksheet.firstRow or greater then Worksheet.lastRow.

hasRowAt

boolean hasRowAt(int index)
Specifies whether this table has a row at the given index.


getRows

Collection<Row> getRows()
Gets all the rows of this table in the order of their index.

Returns:
A collection of rows.

getRowMap

TreeMap<Integer,Row> getRowMap()
Gets all the rows of this table. The key of the Map.Entrys is of type Integer and stands for the index number of the row.

Returns:
A TreeMap of rows.

rowIterator

Iterator<Row> rowIterator()
Returns an iterator for the rows in this table. Rows are aware of their index number when passed by this iterator.

Returns:
An iterator for the rows in this table.

rowCount

int rowCount()
Returns the number of rows in this table.

Returns:
The number of rows in this table.

columnCount

int columnCount()
Returns the number of columns in this table.

Returns:
The number of columns in this table.

hasChildren

boolean hasChildren()
Indicates whether this table has any rows or columns.


maxCellIndex

int maxCellIndex()
Gets the highest index number of all the cells of all the rows in this table: the right-most cell.

Returns:
The highest index number of cells in this table.

maxRowIndex

int maxRowIndex()
Gets the highest index number of the rows in this table.

Returns:
The highest index number of the rows in this table.

maxColumnIndex

int maxColumnIndex()
Gets the highest index number of the columns in this table.

Returns:
The highest index number of the columns in this table.

getExpandedColumnCount

int getExpandedColumnCount()
An indicator of the index of the right-most column on this table. May have been set when reading workbooks.

Returns:
an indicator of the index of the right-most column

getExpandedRowCount

int getExpandedRowCount()
An indicator of the index of the bottom row on this table. May have been set when reading workbooks.

Returns:
an indicator of the index of the bottom row

xelem.3.0