xelem.3.0

nl.fountain.xelem.excel.ss
Class SSWorksheet

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

public class SSWorksheet
extends AbstractXLElement
implements Worksheet

An implementation of the XLElement Worksheet.

This class can be used to add rows, columns and cells to the worksheet. The addCell-methods add a cell at the current position of the worksheet's cellPointer (see getCellPointer()) and move the cellPointer. If you whish to obtain the address of the newly added cell, it should be obtained from the cellPointer prior to the add:

          Address adr = sheet.getCellPointer().getAddress();
          Cell cell = sheet.addCell();
 
The addCellAt-methods, which take an address, a string or a row/column pair of ints as parameter, move the cellPointer to the specified position, add a cell and leave the cellPointer pointing to the next position.


Field Summary
 
Fields inherited from interface nl.fountain.xelem.excel.Worksheet
firstColumn, firstRow, lastColumn, lastRow
 
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
SSWorksheet(String name)
          Constructs a new SSWorksheet with the given name.
 
Method Summary
 Cell addCell()
          Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
 Cell addCell(Cell cell)
          Adds the given cell at the current position of the worksheets CellPointer and moves the cellpointer.
 Cell addCell(double data)
          Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
 Cell addCell(double data, String styleID)
          Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
 Cell addCell(int data)
          Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
 Cell addCell(int data, String styleID)
          Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
 Cell addCell(Object data)
          Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
 Cell addCell(Object data, String styleID)
          Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
 Cell addCellAt(Address address)
          Adds a new cell at the given address.
 Cell addCellAt(Address address, Cell cell)
          Adds the given cell at the given address.
 Cell addCellAt(int rowIndex, int columnIndex)
          Adds a new cell at the given row and column index.
 Cell addCellAt(int rowIndex, int columnIndex, Cell cell)
          Adds the given cell at the given row and column index.
 Cell addCellAt(String a1_ref)
          Adds a new cell at the address specified by the A1-reference string.
 Cell addCellAt(String a1_ref, Cell cell)
          Adds the given cell at the address specified by the A1-reference string.
 Column addColumn()
          Adds a new Column to this worksheet.
 Column addColumn(Column column)
          Adds the given column to this worksheet.
 Column addColumnAt(int index)
          Adds a new Column at the given index to this worksheet.
 Column addColumnAt(int index, Column column)
          Adds the given Column at the given index to this worksheet.
 Column addColumnAt(String label)
          Adds a new Column at the index specified by the given label.
 Column addColumnAt(String label, Column column)
          Adds the given Column at the given index specified by the given label.
 NamedRange addNamedRange(NamedRange nr)
          Adds a new NamedRange to this worksheet.
 NamedRange addNamedRange(String name, String refersTo)
          Adds a new NamedRange to this worksheet.
 Row addRow()
          Adds a new Row to this worksheet.
 Row addRow(Row row)
          Adds the given row to this worksheet.
 Row addRowAt(int rowIndex)
          Adds a new Row at the given index to this worksheet.
 Row addRowAt(int index, Row row)
          Adds the given Row at the given index to this worksheet.
 Element assemble(Element parent, GIO gio)
          Assembles the state of this XLElement and all of it's children into an Element.
 Cell getCellAt(Address address)
          Gets the cell at the given address.
 Cell getCellAt(int rowIndex, int columnIndex)
          Gets the cell at the given coordinates.
 Cell getCellAt(String a1_ref)
          Gets the cell at address specified by the given string in A1-reference style.
 CellPointer getCellPointer()
          Gets the cellpointer of this worksheet.
 Column getColumnAt(int columnIndex)
          Gets the column at the given index.
 Column getColumnAt(String label)
          Gets the column at the index specified by the given label.
 Collection<Column> getColumns()
          Gets all the columns of this worksheet in the order of their index.
 String getName()
          Returns the name of this worksheet.
 Map<String,NamedRange> getNamedRanges()
          Gets all the NamedRanges that were added to this worksheet.
 String getNameSpace()
          Gets the namespace of this XLElement.
 String getPrefix()
          Gets the prefix of this XLElement.
 String getReferenceName()
          Returns the name of this worksheet for purposes of reference.
 Row getRowAt(int rowIndex)
          Gets the row at the given index.
 Collection<Row> getRows()
          Gets all the rows of this worksheet in the order of their index.
 Table getTable()
          Gets the table of this worksheet.
 String getTagName()
          Gets the tagname (localName) of this XLElement.
 WorksheetOptions getWorksheetOptions()
          Gets the WorksheetOptions of this worksheet.
 boolean hasAutoFilter()
          Specifies whether the setAutoFilter-method was applied on this worksheet.
 boolean hasCellAt(Address address)
          Specifies whether there is a cell at the given address.
 boolean hasCellAt(int rowIndex, int columnIndex)
          Specifies whether there is a cell at the intersection of the given row and column index.
 boolean hasCellAt(String a1_ref)
          Specifies whether there is a cell at the address specified by the given string in A1-reference style.
 boolean hasColumnAt(int columnIndex)
          Specifies whether there is a column at the given column index.
 boolean hasColumnAt(String label)
          Specifies whether there is a column at the index specified by the given label.
 boolean hasRowAt(int rowIndex)
          Specifies whether there is a row at the given row index.
 boolean hasTable()
          Indicates whether this worksheet has a table.
 boolean hasWorksheetOptions()
          Indicates whether WorksheetOptions was added to this worksheet.
 boolean isProtected()
          Specifies whether protection is applied to this worksheet.
 boolean isRightToLeft()
          Specifies whether this worksheet is displayed from right to left.
 void removeAutoFilter()
          Removes the Autofilter on this worksheet.
 Cell removeCellAt(Address address)
          Removes the cell at the given address.
 Cell removeCellAt(int rowIndex, int columnIndex)
          Removes the cell at the given coordinates.
 Cell removeCellAt(String a1_ref)
          Removes the cell at the address specified by the A1-reference string.
 Column removeColumnAt(int columnIndex)
          Removes the column at the given index.
 Column removeColumnAt(String label)
          Removes the column at the index specified by the given label.
 Row removeRowAt(int rowIndex)
          Removes the row at the given index.
 void setAttributes(Attributes attrs)
          Does effectively nothing.
 void setAutoFilter(AutoFilter af)
          Sets the AutoFilter on this worksheet.
 void setAutoFilter(String rcString)
          Sets the AutoFilter-option on the specified range.
 void setProtected(boolean p)
          Sets whether protection will be applied to this worksheet.
 void setRightToLeft(boolean r)
          Sets whether this worksheet will be displayed from right to left.
 void setTable(Table table)
          Sets the given table as the table of this worksheet.
 void setWorksheetOptions(WorksheetOptions wso)
          Sets the given worksheetOptions as the worksheetOptions of this worksheet.
 
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

SSWorksheet

public SSWorksheet(String name)
Constructs a new SSWorksheet with the given name. The worksheets cellpointer will be at position row 1, column 1.

See Also:
Workbook.addSheet()
Method Detail

getName

public String getName()
Description copied from interface: Worksheet
Returns the name of this worksheet.

Specified by:
getName in interface Worksheet
Returns:
the name of this worksheet

getReferenceName

public String getReferenceName()
Description copied from interface: Worksheet
Returns the name of this worksheet for purposes of reference.

Specified by:
getReferenceName in interface Worksheet
Returns:
the name of this worksheet or, if there are spaces in the name, the name of this worksheet between single quoutes ('...')

setProtected

public void setProtected(boolean p)
Description copied from interface: Worksheet
Sets whether protection will be applied to this worksheet.

Specified by:
setProtected in interface Worksheet

isProtected

public boolean isProtected()
Description copied from interface: Worksheet
Specifies whether protection is applied to this worksheet.

Specified by:
isProtected in interface Worksheet
Returns:
true if this worksheet is protected

setRightToLeft

public void setRightToLeft(boolean r)
Description copied from interface: Worksheet
Sets whether this worksheet will be displayed from right to left.

Specified by:
setRightToLeft in interface Worksheet

isRightToLeft

public boolean isRightToLeft()
Description copied from interface: Worksheet
Specifies whether this worksheet is displayed from right to left.

Specified by:
isRightToLeft in interface Worksheet
Returns:
true if this worksheet is displayed from right to left

addNamedRange

public NamedRange addNamedRange(NamedRange nr)
Description copied from interface: Worksheet
Adds a new NamedRange to this worksheet. If this workbook allready contained a NamedRange with the same name, replaces that NamedRange.

If the workbook has a named range with the same name, the named range on the worksheet level has precedence over the one defined on the workbook level.

Specified by:
addNamedRange in interface Worksheet
Parameters:
nr - the NamedRange to be added to this worksheet
Returns:
the given NamedRange

addNamedRange

public NamedRange addNamedRange(String name,
                                String refersTo)
Description copied from interface: Worksheet
Adds a new NamedRange to this worksheet. Named ranges are usefull when working with formulas. If this workbook allready contained a NamedRange with the same name, replaces that NamedRange.

If the workbook has a named range with the same name, the named range on the worksheet level has precedence over the one defined on the workbook level.

The string refersTo should be in R1C1-reference style i.e. in the format [worksheet name]!R1C1:R1C1. You may skip the worksheet indicator: R1C1:R1C1 will do as well.

Specified by:
addNamedRange in interface Worksheet
Parameters:
name - The name to apply to the range.
refersTo - A String of R1C1-reference style.
Returns:
New NamedRange.

getNamedRanges

public Map<String,NamedRange> getNamedRanges()
Description copied from interface: Worksheet
Gets all the NamedRanges that were added to this worksheet. The map-keys are equal to their names.

Specified by:
getNamedRanges in interface Worksheet
Returns:
a map with NamedRanges

setWorksheetOptions

public void setWorksheetOptions(WorksheetOptions wso)
Description copied from interface: Worksheet
Sets the given worksheetOptions as the worksheetOptions of this worksheet.

Specified by:
setWorksheetOptions in interface Worksheet
Parameters:
wso - the worksheetOptions to be set on this worksheet

hasWorksheetOptions

public boolean hasWorksheetOptions()
Description copied from interface: Worksheet
Indicates whether WorksheetOptions was added to this worksheet.

Specified by:
hasWorksheetOptions in interface Worksheet
Returns:
true if this worksheet has WorksheetOptions.

getWorksheetOptions

public WorksheetOptions getWorksheetOptions()
Description copied from interface: Worksheet
Gets the WorksheetOptions of this worksheet.

Specified by:
getWorksheetOptions in interface Worksheet
Returns:
The WorksheetOptions of this worksheet. Never null.

setTable

public void setTable(Table table)
Description copied from interface: Worksheet
Sets the given table as the table of this worksheet.

Specified by:
setTable in interface Worksheet
Parameters:
table - the table to be set on this worksheet

getTable

public Table getTable()
Description copied from interface: Worksheet
Gets the table of this worksheet.

Specified by:
getTable in interface Worksheet
Returns:
The table of this worksheet. Never null.

hasTable

public boolean hasTable()
Description copied from interface: Worksheet
Indicates whether this worksheet has a table.

Specified by:
hasTable in interface Worksheet

getCellPointer

public CellPointer getCellPointer()
Description copied from interface: Worksheet
Gets the cellpointer of this worksheet.

Specified by:
getCellPointer in interface Worksheet
Returns:
This worksheets cellpointer.

addCell

public Cell addCell()
Description copied from interface: Worksheet
Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
If this worksheet did not have a table, a new table will be added.

Specified by:
addCell in interface Worksheet
Returns:
A new cell with an initial datatype of "String" and an empty ("") value.
See Also:
CellPointer.move()

addCell

public Cell addCell(Cell cell)
Description copied from interface: Worksheet
Adds the given cell at the current position of the worksheets CellPointer and moves the cellpointer.
If this worksheet did not have a table, a new table will be added.

Specified by:
addCell in interface Worksheet
Returns:
The passed cell.
See Also:
CellPointer.move()

addCell

public Cell addCell(Object data)
Description copied from interface: Worksheet
Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
If this worksheet did not have a table, a new table will be added.

Datatype and value of the new cell depend on the passed object.

Specified by:
addCell in interface Worksheet
Parameters:
data - The data to be displayed in this cell.
Returns:
A new cell.
See Also:
Cell.setData(Object), CellPointer.move()

addCell

public Cell addCell(Object data,
                    String styleID)
Description copied from interface: Worksheet
Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
If this worksheet did not have a table, a new table will be added.

Datatype and value of the new cell depend on the passed object. The new cell will have it's styleID set to the given id.

Specified by:
addCell in interface Worksheet
Parameters:
data - The data to be displayed in this cell.
styleID - The id of the style to employ on this cell.
Returns:
A new cell.
See Also:
Cell.setData(Object), Cell.setStyleID(String), CellPointer.move()

addCell

public Cell addCell(double data)
Description copied from interface: Worksheet
Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
If this worksheet did not have a table, a new table will be added.

Specified by:
addCell in interface Worksheet
Parameters:
data - The data to be displayed in this cell.
Returns:
A new cell with a datatype "Number" and the given double as value.
See Also:
Cell.setData(double), CellPointer.move()

addCell

public Cell addCell(double data,
                    String styleID)
Description copied from interface: Worksheet
Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
If this worksheet did not have a table, a new table will be added. The new cell will have it's styleID set to the given id.

Specified by:
addCell in interface Worksheet
Parameters:
data - The data to be displayed in this cell.
styleID - The id of the style to employ on this cell.
Returns:
A new cell with a datatype "Number" and the given double as value.
See Also:
Cell.setData(double), Cell.setStyleID(String), CellPointer.move()

addCell

public Cell addCell(int data)
Description copied from interface: Worksheet
Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
If this worksheet did not have a table, a new table will be added.

Specified by:
addCell in interface Worksheet
Parameters:
data - The data to be displayed in this cell.
Returns:
A new cell with a datatype "Number" and the given int as value.
See Also:
CellPointer.move()

addCell

public Cell addCell(int data,
                    String styleID)
Description copied from interface: Worksheet
Adds a new cell at the current position of the worksheets CellPointer and moves the cellpointer.
If this worksheet did not have a table, a new table will be added.

Specified by:
addCell in interface Worksheet
Parameters:
data - The data to be displayed in this cell.
styleID - The id of the style to employ on this cell.
Returns:
A new cell with a datatype "Number" and the given int as value.
See Also:
Cell.setStyleID(String), CellPointer.move()

addCellAt

public Cell addCellAt(Address address)
Description copied from interface: Worksheet
Adds a new cell at the given address. If this worksheet didn't have a row at the row index of the given address, a new row will be added. If there was a cell at the given address, replaces this cell. If this worksheet did not have a table, a new table will be added.
Moves the cellpointer to a new position relative to address.

Specified by:
addCellAt in interface Worksheet
Parameters:
address - The address where the new cell should be added.
Returns:
A new cell with an initial datatype of "String" and an empty ("") value.
See Also:
CellPointer.move()

addCellAt

public Cell addCellAt(int rowIndex,
                      int columnIndex)
Description copied from interface: Worksheet
Adds a new cell at the given row and column index. If this worksheet didn't have a row at the given index, a new row will be added. If the place at the given coordinates was allredy occupied by another cell, replaces this cell. If this worksheet did not have a table, a new table will be added.
Moves the cellpointer to a new position relative to rowIndex and columnIndex.

Specified by:
addCellAt in interface Worksheet
Parameters:
rowIndex - The row index (row number).
columnIndex - The column index (column number).
Returns:
A new cell with an initial datatype of "String" and an empty ("") value.
See Also:
CellPointer.move()

addCellAt

public Cell addCellAt(String a1_ref)
Description copied from interface: Worksheet
Adds a new cell at the address specified by the A1-reference string. If this worksheet didn't have a row at the row index specified, a new row will be added. If the place at the given coordinates was allredy occupied by another cell, replaces this cell. If this worksheet did not have a table, a new table will be added.
Moves the cellpointer to a new position relative to the address specified by the A1-reference string.

Specified by:
addCellAt in interface Worksheet
Parameters:
a1_ref - a string in A1-reference style
Returns:
A new cell with an initial datatype of "String" and an empty ("") value.
See Also:
CellPointer.move()

addCellAt

public Cell addCellAt(Address address,
                      Cell cell)
Description copied from interface: Worksheet
Adds the given cell at the given address. If this worksheet didn't have a row at the row index of the given address, a new row will be added. If there was a cell at the given address, replaces this cell. If this worksheet did not have a table, a new table will be added.
Moves the cellpointer to a new position relative to address.

Specified by:
addCellAt in interface Worksheet
Parameters:
address - The address where the cell should be added.
cell - The cell to be added.
Returns:
The passed cell.
See Also:
CellPointer.move()

addCellAt

public Cell addCellAt(int rowIndex,
                      int columnIndex,
                      Cell cell)
Description copied from interface: Worksheet
Adds the given cell at the given row and column index. If this worksheet didn't have a row at the given index, a new row will be added. If the place at the given coordinates was allredy occupied by another cell, replaces this cell. If this worksheet did not have a table, a new table will be added.
Moves the cellpointer to a new position relative to rowIndex and columnIndex.

Specified by:
addCellAt in interface Worksheet
Parameters:
rowIndex - The row index (row number).
columnIndex - The column index (column number).
cell - The cell to be added.
Returns:
The passed cell.
See Also:
CellPointer.move()

addCellAt

public Cell addCellAt(String a1_ref,
                      Cell cell)
Description copied from interface: Worksheet
Adds the given cell at the address specified by the A1-reference string. If this worksheet didn't have a row at the index specified, a new row will be added. If the place at the given coordinates was allredy occupied by another cell, replaces this cell. If this worksheet did not have a table, a new table will be added.
Moves the cellpointer to a new position relative to the address specified by the A1-reference string.

Specified by:
addCellAt in interface Worksheet
Parameters:
a1_ref - a string of A1-reference style
cell - the cell to be added.
Returns:
The passed cell.
See Also:
CellPointer.move()

getCellAt

public Cell getCellAt(Address address)
Description copied from interface: Worksheet
Gets the cell at the given address.

Specified by:
getCellAt in interface Worksheet
Parameters:
address - The position of the cell.
Returns:
The cell at the given address. Never null

getCellAt

public Cell getCellAt(int rowIndex,
                      int columnIndex)
Description copied from interface: Worksheet
Gets the cell at the given coordinates.

Specified by:
getCellAt in interface Worksheet
Parameters:
rowIndex - The row index (row number).
columnIndex - The column index (column number).
Returns:
The cell at the given coordinates. Never null

getCellAt

public Cell getCellAt(String a1_ref)
Description copied from interface: Worksheet
Gets the cell at address specified by the given string in A1-reference style.

Specified by:
getCellAt in interface Worksheet
Parameters:
a1_ref - a string of A1-reference style
Returns:
The cell at the given coordinates. Never null

removeCellAt

public Cell removeCellAt(Address address)
Description copied from interface: Worksheet
Removes the cell at the given address.

Specified by:
removeCellAt in interface Worksheet
Parameters:
address - The position of the cell to remove.
Returns:
The removed cell or null.

removeCellAt

public Cell removeCellAt(int rowIndex,
                         int columnIndex)
Description copied from interface: Worksheet
Removes the cell at the given coordinates.

Specified by:
removeCellAt in interface Worksheet
Parameters:
rowIndex - The row index (row number).
columnIndex - The column index (column number).
Returns:
The removed cell or null.

removeCellAt

public Cell removeCellAt(String a1_ref)
Description copied from interface: Worksheet
Removes the cell at the address specified by the A1-reference string.

Specified by:
removeCellAt in interface Worksheet
Parameters:
a1_ref - a string of A1-reference style
Returns:
The removed cell or null.

hasCellAt

public boolean hasCellAt(Address address)
Description copied from interface: Worksheet
Specifies whether there is a cell at the given address.

Specified by:
hasCellAt in interface Worksheet

hasCellAt

public boolean hasCellAt(int rowIndex,
                         int columnIndex)
Description copied from interface: Worksheet
Specifies whether there is a cell at the intersection of the given row and column index.

Specified by:
hasCellAt in interface Worksheet

hasCellAt

public boolean hasCellAt(String a1_ref)
Description copied from interface: Worksheet
Specifies whether there is a cell at the address specified by the given string in A1-reference style.

Specified by:
hasCellAt in interface Worksheet

addRow

public Row addRow()
Description copied from interface: Worksheet
Adds a new Row to this worksheet. If no rows were previously added the row will be added at index 1. Otherwise the row will be added at maxRowIndex of the underlying Table + 1.

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

addRowAt

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

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

addRow

public Row addRow(Row row)
Description copied from interface: Worksheet
Adds the given row to this worksheet. If no rows were previously added the row will be added at index 1. Otherwise the row will be added at maxRowIndex of the underlying Table + 1.

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

addRowAt

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

Specified by:
addRowAt in interface Worksheet
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: Worksheet
Removes the row at the given index.

Specified by:
removeRowAt in interface Worksheet
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: Worksheet
Gets all the rows of this worksheet in the order of their index.

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

getRowAt

public Row getRowAt(int rowIndex)
Description copied from interface: Worksheet
Gets the row at the given index.

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

hasRowAt

public boolean hasRowAt(int rowIndex)
Description copied from interface: Worksheet
Specifies whether there is a row at the given row index.

Specified by:
hasRowAt in interface Worksheet

addColumn

public Column addColumn()
Description copied from interface: Worksheet
Adds a new Column to this worksheet. If no columns were previously added the column will be added at index 1. Otherwise the column will be added at maxColumnIndex of the underlying Table + 1.

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

addColumnAt

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

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

addColumnAt

public Column addColumnAt(String label)
Description copied from interface: Worksheet
Adds a new Column at the index specified by the given label. If the index was allready occupied by another column, replaces this column.

Specified by:
addColumnAt in interface Worksheet
Parameters:
label - a string ("A" through "IV" inclusive) corresponding to the column index
Returns:
A new column.

addColumn

public Column addColumn(Column column)
Description copied from interface: Worksheet
Adds the given column to this worksheet. If no columns were previously added the column will be added at index 1. Otherwise the ccolumn will be added at maxColumnIndex of the underlying Table + 1.

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

addColumnAt

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

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

addColumnAt

public Column addColumnAt(String label,
                          Column column)
Description copied from interface: Worksheet
Adds the given Column at the given index specified by the given label. If the index was allready occupied by another column, replaces this column.

Specified by:
addColumnAt in interface Worksheet
Parameters:
label - a string ("A" through "IV" inclusive) corresponding to the column index
column - The column to be added.
Returns:
The passed column.

removeColumnAt

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

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

removeColumnAt

public Column removeColumnAt(String label)
Description copied from interface: Worksheet
Removes the column at the index specified by the given label.

Specified by:
removeColumnAt in interface Worksheet
Parameters:
label - a string ("A" through "IV" inclusive) corresponding to the column index
Returns:
The removed column or null if the index was not occupied by a column.

getColumns

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

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

getColumnAt

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

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

getColumnAt

public Column getColumnAt(String label)
Description copied from interface: Worksheet
Gets the column at the index specified by the given label. If no column was at the index, returns a new column.

Specified by:
getColumnAt in interface Worksheet
Parameters:
label - a string ("A" through "IV" inclusive) corresponding to the column index
Returns:
The column at the given index. Never null.

hasColumnAt

public boolean hasColumnAt(int columnIndex)
Description copied from interface: Worksheet
Specifies whether there is a column at the given column index.

Specified by:
hasColumnAt in interface Worksheet

hasColumnAt

public boolean hasColumnAt(String label)
Description copied from interface: Worksheet
Specifies whether there is a column at the index specified by the given label.

Specified by:
hasColumnAt in interface Worksheet
Parameters:
label - a string ("A" through "IV" inclusive) corresponding to the column index

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

setAutoFilter

public void setAutoFilter(AutoFilter af)
Description copied from interface: Worksheet
Sets the AutoFilter on this worksheet.

Specified by:
setAutoFilter in interface Worksheet
Parameters:
af - the AutoFilter to be set on this worksheet.

setAutoFilter

public void setAutoFilter(String rcString)
Description copied from interface: Worksheet
Sets the AutoFilter-option on the specified range.

The String rcString should include all of the columns that are to be equiped with a drop-down button at their column- headings, and should either include just the row of the column-headings or the entire range on which the AutoFilter must be set.

Here are some examples:
Given a table of 3 columns and 11 rows. The column-headings are at row 10. The table-data expands to row 21.

Specified by:
setAutoFilter in interface Worksheet
Parameters:
rcString - A String of R1C1 reference style.

hasAutoFilter

public boolean hasAutoFilter()
Description copied from interface: Worksheet
Specifies whether the setAutoFilter-method was applied on this worksheet.

Specified by:
hasAutoFilter in interface Worksheet
Returns:
true if the setAutoFilter-method was applied on this worksheet, false otherwise.

removeAutoFilter

public void removeAutoFilter()
Description copied from interface: Worksheet
Removes the Autofilter on this worksheet.

Specified by:
removeAutoFilter in interface Worksheet

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

xelem.3.0