org.odftoolkit.simple.table
Class CellRange

java.lang.Object
  extended by org.odftoolkit.simple.table.CellRange

public class CellRange
extends Object

CellRange represent a rang of cells that are adjacent with each other

CellRange provides methods to get/set/modify the properties of cell range.


Method Summary
 Cell getCellByPosition(int clmIndex, int rowIndex)
          Returns a single cell that is positioned at specified column and row.
 Cell getCellByPosition(String address)
          Returns a single cell that is positioned at specified cell address.
 String getCellRangeName()
          Get the name of the named cell range.
 int getColumnNumber()
          Get the number of columns in this cell range.
 int getRowNumber()
          Get the number of rows in this cell range.
 Table getTable()
          Get the Table instance who contains this cell range.
 void merge()
          Merge the current cell range to one cell
 void setCellRangeName(String cellRangeName)
          Set the name of the current cell range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

merge

public void merge()
Merge the current cell range to one cell


getCellRangeName

public String getCellRangeName()
Get the name of the named cell range.

Returns:
the name of the cell range

setCellRangeName

public void setCellRangeName(String cellRangeName)
Set the name of the current cell range.

Parameters:
cellRangeName - the name that need to set

getTable

public Table getTable()
Get the Table instance who contains this cell range.

Returns:
the table that contains the cell range.

getRowNumber

public int getRowNumber()
Get the number of rows in this cell range.

Returns:
rows number in the cell range

getColumnNumber

public int getColumnNumber()
Get the number of columns in this cell range.

Returns:
columns number in the cell range

getCellByPosition

public Cell getCellByPosition(int clmIndex,
                              int rowIndex)
                       throws IndexOutOfBoundsException
Returns a single cell that is positioned at specified column and row.

Parameters:
clmIndex - the column index of the cell inside the range.
rowIndex - the row index of the cell inside the range.
Returns:
the cell at the specified position relative to the start position of the cell range
Throws:
IndexOutOfBoundsException - if the column/row index is bigger than the column/row count

getCellByPosition

public Cell getCellByPosition(String address)
Returns a single cell that is positioned at specified cell address.

Parameters:
address - the cell address of the cell inside the range.
Returns:
the cell at the specified cell address relative to the start position of the cell range


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.