sos.reports
Interface TableElement

All Superinterfaces:
Element
All Known Implementing Classes:
AbstractReport.AbstractTableElement, AbstractReport.DefaultTableElement

public interface TableElement
extends Element

A portion of a report organized into rows and columns.

A table element consists of rows, columns, and cells. Cells can span one or more rows and columns. Currently, only one cell is allowed to exist at the intersection of a row and a column, but this may be relaxed in the future.

The word "tier" is used to refer to either a row or a column. Some tiers may be designated as header tiers. Header tiers must be the first tiers in the table. Similarly, some tiers may be designated as footer tiers. Footer tiers must be the last tiers in the table.

Since:
1.0
See Also:
CellElement, TierElement

Field Summary
static int COLUMN
          A constant that indicates the column direction.
static int ROW
          A constant that indicates the row direction.
 
Method Summary
 CellElement getCellAt(int rowIndex, int columnIndex)
          Returns the cell at the specified location.
 java.util.Set getCells()
          Returns all cells belonging to this table element.
 java.util.Set getCellsEntirelyInRegion(int firstRowIndex, int firstColumnIndex, int lastRowIndex, int lastColumnIndex)
          Returns the cells that fall entirely within the specified region.
 java.util.Set getCellsEntirelyInTier(int tierType, int index)
          Returns the set of cells entirely in the specified row or column.
 java.util.Set getCellsInRegion(int firstRowIndex, int firstColumnIndex, int lastRowIndex, int lastColumnIndex)
          Returns the cells that fall within the specified region.
 java.util.Set getCellsInTier(int tierType, int index)
          Returns the set of cells in the specified row or column.
 CellElement getCellStartingAt(int rowIndex, int columnIndex)
          Returns the cell that starts at the specified location.
 int getFooterTierCount(int tierType)
          Returns the number of footer rows or footer columns in this table element.
 int getHeaderTierCount(int tierType)
          Returns the number of header rows or header columns in this table element.
 TierElement getTierAt(int tierType, int index)
          Returns the tier row or column representing the specified index.
 int getTierCount(int tierType)
          Returns the total number of rows or columns.
 
Methods inherited from interface sos.reports.Element
getAttributes, getName, getObject, getParentElement, getPrototypeObject, getReport, setParentElement
 

Field Detail

ROW

public static final int ROW
A constant that indicates the row direction.

See Also:
COLUMN, Constant Field Values

COLUMN

public static final int COLUMN
A constant that indicates the column direction.

See Also:
ROW, Constant Field Values
Method Detail

getCells

public java.util.Set getCells()
Returns all cells belonging to this table element.

Returns:
an unmodifiable set containing this table's cells

getCellsInRegion

public java.util.Set getCellsInRegion(int firstRowIndex,
                                      int firstColumnIndex,
                                      int lastRowIndex,
                                      int lastColumnIndex)
                               throws java.lang.IndexOutOfBoundsException
Returns the cells that fall within the specified region.

Parameters:
firstRowIndex - index of the first row of the region
firstColumnIndex - index of the first column of the region
lastRowIndex - index of the last row of the region (inclusive)
lastColumnIndex - index of the last column of the region (inclusive)
Returns:
an unmodifiable set of cells in the specified region
Throws:
java.lang.IndexOutOfBoundsException - if any index is negative, if an end index is less than its corresponding start index, or if an end index is greater than or equal to the number of corresponding tiers in this table
See Also:
getCellsEntirelyInRegion(int, int, int, int)

getCellsEntirelyInRegion

public java.util.Set getCellsEntirelyInRegion(int firstRowIndex,
                                              int firstColumnIndex,
                                              int lastRowIndex,
                                              int lastColumnIndex)
                                       throws java.lang.IndexOutOfBoundsException
Returns the cells that fall entirely within the specified region.

Parameters:
firstRowIndex - index of the first row of the region
firstColumnIndex - index of the first column of the region
lastRowIndex - index of the last row of the region (inclusive)
lastColumnIndex - index of the last column of the region (inclusive)
Returns:
an unmodifiable set of cells entirely within the specified region
Throws:
java.lang.IndexOutOfBoundsException - if any index is negative, if an end index is less than its corresponding start index, or if an end index is greater than or equal to the number of tiers in this table element
See Also:
getCellsInRegion(int, int, int, int)

getCellsEntirelyInTier

public java.util.Set getCellsEntirelyInTier(int tierType,
                                            int index)
                                     throws java.lang.IllegalArgumentException,
                                            java.lang.IndexOutOfBoundsException
Returns the set of cells entirely in the specified row or column.

Parameters:
tierType - type of tier (either ROW or COLUMN)
index - index of row or column to fetch
Returns:
an unmodifiable set of cells entirely in the specified row or column
Throws:
java.lang.IllegalArgumentException - if tierType is not ROW or COLUMN;
java.lang.IndexOutOfBoundsException - if index is negative or greater than or equal to the number of tiers in this table element
See Also:
getCellsInTier(int, int)

getCellsInTier

public java.util.Set getCellsInTier(int tierType,
                                    int index)
                             throws java.lang.IllegalArgumentException,
                                    java.lang.IndexOutOfBoundsException
Returns the set of cells in the specified row or column.

Parameters:
tierType - type of tier (either ROW or COLUMN)
index - index of row or column to fetch
Returns:
an unmodifiable set of cells in the specified row or column
Throws:
java.lang.IllegalArgumentException - if tierType is not ROW or COLUMN;
java.lang.IndexOutOfBoundsException - if index is negative or greater than or equal to the number of tiers in this table element
See Also:
getCellsEntirelyInTier(int, int)

getCellAt

public CellElement getCellAt(int rowIndex,
                             int columnIndex)
                      throws java.lang.IndexOutOfBoundsException
Returns the cell at the specified location.

Parameters:
rowIndex - row index of cell to fetch
columnIndex - column index of cell to fetch
Returns:
the cell at the specified location or null if there is no cell
Throws:
java.lang.IndexOutOfBoundsException - if either index is negative or greater than or equal to the number of tiers in this table element

getCellStartingAt

public CellElement getCellStartingAt(int rowIndex,
                                     int columnIndex)
                              throws java.lang.IndexOutOfBoundsException
Returns the cell that starts at the specified location.

Parameters:
rowIndex - row index of cell to fetch
columnIndex - column index of cell to fetch
Returns:
the cell that starts the specified location or null if there is no cell
Throws:
java.lang.IndexOutOfBoundsException - if either index is negative or greater than or equal to the number of tiers in this table element

getHeaderTierCount

public int getHeaderTierCount(int tierType)
                       throws java.lang.IllegalArgumentException
Returns the number of header rows or header columns in this table element. If the specified direction is ROW, the number of header rows is given; if COLUMN, the number of header columns is given. The returned count may be zero and must be less than the toal number of tiers.

Parameters:
tierType - type of tier (either ROW or COLUMN)
Returns:
the number of header rows (if ROW) or header columns (if COLUMN)
Throws:
java.lang.IllegalArgumentException - if tierType is not ROW or COLUMN
See Also:
getFooterTierCount(int), getTierCount(int)

getTierCount

public int getTierCount(int tierType)
                 throws java.lang.IllegalArgumentException
Returns the total number of rows or columns. If tierType is ROW, the row count is given; if tierType is COLUMN, the column count is given. The returned count includes header and footer tiers.

Parameters:
tierType - type of tier (either ROW or COLUMN)
Returns:
the total number of rows (if ROW) or columns (if COLUMN)
Throws:
java.lang.IllegalArgumentException - if tierType is not ROW or COLUMN

getTierAt

public TierElement getTierAt(int tierType,
                             int index)
                      throws java.lang.IllegalArgumentException,
                             java.lang.IndexOutOfBoundsException
Returns the tier row or column representing the specified index.

Parameters:
tierType - type of tier (either ROW or COLUMN)
index - index of the tier to be retrieved
Returns:
the tier element for the specified direction and index (may not be null)
Throws:
java.lang.IllegalArgumentException - if tierType is not ROW or COLUMN
java.lang.IndexOutOfBoundsException - if index < 0; or if index is greater than or equal to the total number of tiers in this table element

getFooterTierCount

public int getFooterTierCount(int tierType)
                       throws java.lang.IllegalArgumentException
Returns the number of footer rows or footer columns in this table element. If the specified type is ROW, the number of footer rows is given; if COLUMN, the number of footer columns is given. The returned count may be zero and must be less than the toal number of tiers.

Parameters:
tierType - type of tier (either ROW or COLUMN)
Returns:
the number of footer rows (if ROW) or header columns (if COLUMN)
Throws:
java.lang.IllegalArgumentException - if tierType is not ROW or COLUMN
See Also:
getHeaderTierCount(int), getTierCount(int)


Copyright 2003, 2004 Side of Software (SOS). All rights reserved.