xelem.3.0

nl.fountain.xelem.excel.ss
Class SSTable

java.lang.Object
  extended by nl.fountain.xelem.excel.AbstractXLElement
      extended by nl.fountain.xelem.excel.ss.SSTable
All Implemented Interfaces:
Table, XLElement

public class SSTable
extends AbstractXLElement
implements Table

An implementation of the XLElement Table.


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
 
Constructor Summary
SSTable()
          Constructs a new SSTable.
 
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.
 Element assemble(Element parent, GIO gio)
          Assembles the state of this XLElement and all of it's children into an Element.
 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 columnIndex)
          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.
 String getNameSpace()
          Gets the namespace of this XLElement.
 String getPrefix()
          Gets the prefix of this XLElement.
 Row getRowAt(int rowIndex)
          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.
 String getTagName()
          Gets the tagname (localName) of this XLElement.
 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 columnIndex)
          Removes the column at the given index.
 Row removeRowAt(int rowIndex)
          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 setAttributes(Attributes attrs)
          Does effectively nothing.
 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 class nl.fountain.xelem.excel.AbstractXLElement
addElementComment, assemble, createAttributeNS, createAttributeNS, createElementNS, createElementNS, createElementNS, createElementNS, getElementComments, setChildElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.fountain.xelem.excel.XLElement
addElementComment, getElementComments, setChildElement
 

Constructor Detail

SSTable

public SSTable()
Constructs a new SSTable.

See Also:
Worksheet.getTable()
Method Detail

setStyleID

public void setStyleID(String id)
Description copied from interface: Table
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.

Specified by:
setStyleID in interface Table
Parameters:
id - the id of the style to employ on this table.

getStyleID

public String getStyleID()
Description copied from interface: Table
Gets the ss:StyleID which was set on this table.

Specified by:
getStyleID in interface Table
Returns:
The id of the style to employ on this table or null if no styleID was previously set.

setDefaultRowHeight

public void setDefaultRowHeight(double points)
Description copied from interface: Table
Sets the default row height.

Specified by:
setDefaultRowHeight in interface Table
Parameters:
points - The default row height.

setDefaultColumnWidth

public void setDefaultColumnWidth(double points)
Description copied from interface: Table
Sets the default column width.

Specified by:
setDefaultColumnWidth in interface Table
Parameters:
points - The default column width.

addColumn

public Column addColumn()
Description copied from interface: Table
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 Table.maxColumnIndex() + 1.

Specified by:
addColumn in interface Table
Returns:
A new column.

addColumnAt

public Column addColumnAt(int index)
Description copied from interface: Table
Adds a new Column at the given index to this table. If the index was allready occupied by another column, replaces this column.

Specified by:
addColumnAt in interface Table
Parameters:
index - The index (column number) of the column.
Returns:
A new column.

addColumn

public Column addColumn(Column column)
Description copied from interface: Table
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 Table.maxColumnIndex() + 1.

Specified by:
addColumn in interface Table
Parameters:
column - The column to be added.
Returns:
The passed column.

addColumnAt

public Column addColumnAt(int index,
                          Column column)
Description copied from interface: Table
Adds the given Column at the given index to this table. If the index was allready occupied by another column, replaces this column.

Specified by:
addColumnAt in interface Table
Parameters:
index - The index (column number) of the column.
column - The column to be added.
Returns:
The passed column.

removeColumnAt

public Column removeColumnAt(int columnIndex)
Description copied from interface: Table
Removes the column at the given index.

Specified by:
removeColumnAt in interface Table
Parameters:
columnIndex - The index (column number) of the column.
Returns:
The removed column or null if the index was not occupied by a column.

getColumnAt

public Column getColumnAt(int columnIndex)
Description copied from interface: Table
Gets the column at the given index. If no column was at the given index, returns a new column.

Specified by:
getColumnAt in interface Table
Parameters:
columnIndex - The index (column number) of the column.
Returns:
The column at the given index. Never null.

hasColumnAt

public boolean hasColumnAt(int index)
Description copied from interface: Table
Specifies whether this table has a column at the given index.

Specified by:
hasColumnAt in interface Table

getColumns

public Collection<Column> getColumns()
Description copied from interface: Table
Gets all the columns of this table in the order of their index.

Specified by:
getColumns in interface Table
Returns:
A collection of columns.

addRow

public Row addRow()
Description copied from interface: Table
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 Table.maxRowIndex() + 1.

Specified by:
addRow in interface Table
Returns:
A new Row.

addRowAt

public Row addRowAt(int index)
Description copied from interface: Table
Adds a new Row at the given index to this table. If the index was allready occupied by another row, replaces this row.

Specified by:
addRowAt in interface Table
Parameters:
index - The index (row number) of the row.
Returns:
A new Row.

addRow

public Row addRow(Row row)
Description copied from interface: Table
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 Table.maxRowIndex() + 1.

Specified by:
addRow in interface Table
Parameters:
row - The row to be added.
Returns:
The passed row.

addRowAt

public Row addRowAt(int index,
                    Row row)
Description copied from interface: Table
Adds the given Row at the given index to this table. If the index was allready occupied by another row, replaces this row.

Specified by:
addRowAt in interface Table
Parameters:
index - The index (row number) of the row.
row - The row to be added.
Returns:
The passed row.

removeRowAt

public Row removeRowAt(int rowIndex)
Description copied from interface: Table
Removes the row at the given index.

Specified by:
removeRowAt in interface Table
Parameters:
rowIndex - The index (row number) of the row.
Returns:
The removed row or null if the index was not occupied by a row.

getRows

public Collection<Row> getRows()
Description copied from interface: Table
Gets all the rows of this table in the order of their index.

Specified by:
getRows in interface Table
Returns:
A collection of rows.

getRowMap

public TreeMap<Integer,Row> getRowMap()
Description copied from interface: Table
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.

Specified by:
getRowMap in interface Table
Returns:
A TreeMap of rows.

getRowAt

public Row getRowAt(int rowIndex)
Description copied from interface: Table
Gets the row at the given index. If no row was at the given index, returns a new row at that index.

Specified by:
getRowAt in interface Table
Parameters:
rowIndex - The index (row number) of the row.
Returns:
The row at the given index. Never null

hasRowAt

public boolean hasRowAt(int index)
Description copied from interface: Table
Specifies whether this table has a row at the given index.

Specified by:
hasRowAt in interface Table

rowCount

public int rowCount()
Description copied from interface: Table
Returns the number of rows in this table.

Specified by:
rowCount in interface Table
Returns:
The number of rows in this table.

columnCount

public int columnCount()
Description copied from interface: Table
Returns the number of columns in this table.

Specified by:
columnCount in interface Table
Returns:
The number of columns in this table.

hasChildren

public boolean hasChildren()
Description copied from interface: Table
Indicates whether this table has any rows or columns.

Specified by:
hasChildren in interface Table

maxCellIndex

public int maxCellIndex()
Description copied from interface: Table
Gets the highest index number of all the cells of all the rows in this table: the right-most cell.

Specified by:
maxCellIndex in interface Table
Returns:
The highest index number of cells in this table.

maxRowIndex

public int maxRowIndex()
Description copied from interface: Table
Gets the highest index number of the rows in this table.

Specified by:
maxRowIndex in interface Table
Returns:
The highest index number of the rows in this table.

maxColumnIndex

public int maxColumnIndex()
Description copied from interface: Table
Gets the highest index number of the columns in this table.

Specified by:
maxColumnIndex in interface Table
Returns:
The highest index number of the columns in this table.

rowIterator

public Iterator<Row> rowIterator()
Description copied from interface: Table
Returns an iterator for the rows in this table. Rows are aware of their index number when passed by this iterator.

Specified by:
rowIterator in interface Table
Returns:
An iterator for the rows in this table.

columnIterator

public Iterator<Column> columnIterator()
Description copied from interface: Table
Returns an iterator for the columns in this table. Columns are aware of their index number when passed by this iterator.

Specified by:
columnIterator in interface Table
Returns:
An iterator for the columns in this table.

getTagName

public String getTagName()
Description copied from interface: XLElement
Gets the tagname (localName) of this XLElement.

Specified by:
getTagName in interface XLElement
Returns:
qualified name

getNameSpace

public String getNameSpace()
Description copied from interface: XLElement
Gets the namespace of this XLElement.

Specified by:
getNameSpace in interface XLElement
Returns:
namespace

getPrefix

public String getPrefix()
Description copied from interface: XLElement
Gets the prefix of this XLElement.

Specified by:
getPrefix in interface XLElement
Returns:
prefix

assemble

public Element assemble(Element parent,
                        GIO gio)
Description copied from interface: XLElement
Assembles the state of this XLElement and all of it's children into an Element. Attaches the new element to it's parent-element if needed.

Specified by:
assemble in interface XLElement
Parameters:
parent - the parent-element to which the new formed element will be appended
gio - a global information object
Returns:
the newly assembled element. may be null.

setAttributes

public void setAttributes(Attributes attrs)
Description copied from class: AbstractXLElement
Does effectively nothing.

Specified by:
setAttributes in interface XLElement
Overrides:
setAttributes in class AbstractXLElement
Parameters:
attrs - the attributes found on the element

getExpandedColumnCount

public int getExpandedColumnCount()
Description copied from interface: Table
An indicator of the index of the right-most column on this table. May have been set when reading workbooks.

Specified by:
getExpandedColumnCount in interface Table
Returns:
an indicator of the index of the right-most column

getExpandedRowCount

public int getExpandedRowCount()
Description copied from interface: Table
An indicator of the index of the bottom row on this table. May have been set when reading workbooks.

Specified by:
getExpandedRowCount in interface Table
Returns:
an indicator of the index of the bottom row

xelem.3.0