com.arctorus.documents.table
Class Table

java.lang.Object
  extended by com.arctorus.documents.table.Table

public final class Table
extends java.lang.Object

Table on a page of spreadsheet (xlsx, ods) documents.


Method Summary
 void addMergedCell(MergedCell cell)
          Add merged cell to a table.
static Table createInternalInstance()
          Internal method for creating table.
 Cell getCell(int columnIndex, int rowIndex)
          Get cell by column and row indexes.
 Cell getCell(java.lang.String cellName)
          Get cell by name.
 Cell getCellRef(int columnIndex, int rowIndex)
          Get cell by column and row index.
 Column getColumn(int columnIndex)
          Get column by index.
 Column getColumn(java.lang.String columnName)
          Get column by the specified name.
 int getColumnCount()
          Get number of columns in the table.
 Column getColumnRef(int columnIndex)
          Get column by index.
 java.util.List<Column> getColumns()
          Get list of all non-empty or earlier accessed columns in a table.
 java.util.List<MergedCell> getMergedCells()
          Get list of all merged cells in a table.
 Row getRow(int rowIndex)
          Get row by index.
 int getRowCount()
          Get number of rows in the table.
 Row getRowRef(int rowIndex)
          Get row by index.
 java.util.Collection<Row> getRows()
          Get list of all non-empty or earlier accessed rows in a table.
 boolean hasMergedCells()
          Determines whether the table has merged cells.
 boolean isEmpty()
          Determines whether the table is empty.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createInternalInstance

public static final Table createInternalInstance()
Internal method for creating table. Please don't call it directly and use Page.getTable() instead.


getColumns

public java.util.List<Column> getColumns()
Get list of all non-empty or earlier accessed columns in a table.


getColumn

public Column getColumn(java.lang.String columnName)
Get column by the specified name. If column is not defined then it will be created.

Parameters:
columnName - column name.

getColumn

public Column getColumn(int columnIndex)
Get column by index. If column is not defined then it will be created.

Parameters:
columnIndex - column index.

getRows

public java.util.Collection<Row> getRows()
Get list of all non-empty or earlier accessed rows in a table.


getRow

public Row getRow(int rowIndex)
Get row by index. If row is not defined yet then it will be created.

Parameters:
rowIndex - row index.

getRowCount

public int getRowCount()
Get number of rows in the table.


getColumnCount

public int getColumnCount()
Get number of columns in the table.


addMergedCell

public void addMergedCell(MergedCell cell)
Add merged cell to a table.

Parameters:
cell - new merged cell.

getCell

public Cell getCell(java.lang.String cellName)
Get cell by name. If cell is not defined then it will be created.

Parameters:
cellName - cell name.

getCell

public Cell getCell(int columnIndex,
                    int rowIndex)
Get cell by column and row indexes. If cell is not defined then it will be created.

Parameters:
columnIndex - zero-based column index.
rowIndex - zero-based row index.

getMergedCells

public java.util.List<MergedCell> getMergedCells()
Get list of all merged cells in a table.


hasMergedCells

public boolean hasMergedCells()
Determines whether the table has merged cells.


isEmpty

public boolean isEmpty()
Determines whether the table is empty. Empty table is table without defined rows and columns.


getCellRef

public Cell getCellRef(int columnIndex,
                       int rowIndex)
Get cell by column and row index. If cell is not defined then return null.

Parameters:
columnIndex - column index.
rowIndex - row index.

getRowRef

public Row getRowRef(int rowIndex)
Get row by index. If row is not defined then return null.

Parameters:
rowIndex - row index.

getColumnRef

public Column getColumnRef(int columnIndex)
Get column by index. If column is not defined then return null.

Parameters:
columnIndex - column index.