sos.reports
Class AbstractReport.DefaultTableElement

java.lang.Object
  |
  +--sos.reports.AbstractReport.AbstractElement
        |
        +--sos.reports.AbstractReport.AbstractTableElement
              |
              +--sos.reports.AbstractReport.DefaultTableElement
All Implemented Interfaces:
Element, java.io.Serializable, TableElement
Enclosing class:
AbstractReport

protected class AbstractReport.DefaultTableElement
extends AbstractReport.AbstractTableElement
implements TableElement

A default implementation of TableElement that stores cells in lists of lists.

Since:
1.0

Nested Class Summary
 class AbstractReport.DefaultTableElement.DefaultCellElement
          A default implementation of CellElement.
 class AbstractReport.DefaultTableElement.DefaultTierElement
          A default implementation of TierElement.
 
Field Summary
 
Fields inherited from interface sos.reports.TableElement
COLUMN, ROW
 
Constructor Summary
AbstractReport.DefaultTableElement(java.lang.Object object, java.lang.String styleName)
          Creates an instance of DefaultTableElement with the specified object and style name.
AbstractReport.DefaultTableElement(java.lang.Object object, java.lang.String styleName, int numHeaderRows, int numBodyRows, int numFooterRows, int numHeaderColumns, int numBodyColumns, int numFooterColumns)
           
 
Method Summary
 CellElement getCellAt(int rowIndex, int columnIndex)
          Returns the cell 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.
 java.lang.Object getObject()
          Returns the object (or null, if none) associated with this report element.
protected  java.lang.String getStyleName()
          Returns the name of the style that holds this element's visual properties.
 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.
 void insertTier(int tierType, int index, boolean insertBefore, java.lang.Object tierObject, java.lang.String styleName)
           
 void insertTiers(int tierType, int index, boolean insertBefore, java.util.List objects, java.util.List styleNames)
           
 void removeTier(int tierType, int index)
           
 void removeTiers(int tierType, int index, int numTiersToRemove)
           
 AbstractReport.DefaultTableElement.DefaultCellElement setCell(int rowIndex, int columnIndex, Element cellContentElement, java.lang.String cellStyleName)
           
 AbstractReport.DefaultTableElement.DefaultCellElement setCell(int startRowIndex, int startColumnIndex, int endRowIndex, int endColumnIndex, Element cellElement, java.lang.String cellStyleName)
           
 void setFooterTierCount(int tierType, int count)
           
 void setHeaderTierCount(int tierType, int count)
           
 void setTierPrototype(int tierType, int index, Element prototypeElement, java.lang.String prototypeStyleName)
           
 
Methods inherited from class sos.reports.AbstractReport.AbstractTableElement
fireCellsAdded, fireCellsChanged, fireCellsRemoved, fireContentChanged, fireTableStructureChanged, fireTiersAdded, fireTiersRemoved, getAttributes, getCells, getCellsEntirelyInRegion, getCellsEntirelyInTier, getCellsInRegion, getCellsInTier, getCellStartingAt, getName, getParentElement, getValueIsAdjusting, setParentElement, setValueIsAdjusting
 
Methods inherited from class sos.reports.AbstractReport.AbstractElement
fireObjectChanged, getPrototypeObject, getReport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface sos.reports.TableElement
getCells, getCellsEntirelyInRegion, getCellsEntirelyInTier, getCellsInRegion, getCellsInTier, getCellStartingAt
 
Methods inherited from interface sos.reports.Element
getAttributes, getName, getParentElement, getPrototypeObject, getReport, setParentElement
 

Constructor Detail

AbstractReport.DefaultTableElement

public AbstractReport.DefaultTableElement(java.lang.Object object,
                                          java.lang.String styleName)
Creates an instance of DefaultTableElement with the specified object and style name.

Parameters:
object - object that this table element encapsulates (may be null)
styleName - name of the style that holds this table element's visual properties (may be null)

AbstractReport.DefaultTableElement

public AbstractReport.DefaultTableElement(java.lang.Object object,
                                          java.lang.String styleName,
                                          int numHeaderRows,
                                          int numBodyRows,
                                          int numFooterRows,
                                          int numHeaderColumns,
                                          int numBodyColumns,
                                          int numFooterColumns)
Method Detail

removeTier

public void removeTier(int tierType,
                       int index)

removeTiers

public void removeTiers(int tierType,
                        int index,
                        int numTiersToRemove)

getHeaderTierCount

public int getHeaderTierCount(int tierType)
Description copied from interface: TableElement
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.

Specified by:
getHeaderTierCount in interface TableElement
Overrides:
getHeaderTierCount in class AbstractReport.AbstractTableElement
Parameters:
tierType - type of tier (either ROW or COLUMN)
Returns:
the number of header rows (if ROW) or header columns (if COLUMN)
See Also:
TableElement.getFooterTierCount(int), TableElement.getTierCount(int)

getTierCount

public int getTierCount(int tierType)
Description copied from interface: TableElement
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.

Specified by:
getTierCount in interface TableElement
Parameters:
tierType - type of tier (either ROW or COLUMN)
Returns:
the total number of rows (if ROW) or columns (if COLUMN)

getStyleName

protected java.lang.String getStyleName()
Description copied from class: AbstractReport.AbstractElement
Returns the name of the style that holds this element's visual properties.

Overrides:
getStyleName in class AbstractReport.AbstractElement
Returns:
this element's style name

getFooterTierCount

public int getFooterTierCount(int tierType)
Description copied from interface: TableElement
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.

Specified by:
getFooterTierCount in interface TableElement
Overrides:
getFooterTierCount in class AbstractReport.AbstractTableElement
Parameters:
tierType - type of tier (either ROW or COLUMN)
Returns:
the number of footer rows (if ROW) or header columns (if COLUMN)
See Also:
TableElement.getHeaderTierCount(int), TableElement.getTierCount(int)

getTierAt

public TierElement getTierAt(int tierType,
                             int index)
Description copied from interface: TableElement
Returns the tier row or column representing the specified index.

Specified by:
getTierAt in interface TableElement
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)

getObject

public java.lang.Object getObject()
Description copied from interface: Element
Returns the object (or null, if none) associated with this report element.

Specified by:
getObject in interface Element
Overrides:
getObject in class AbstractReport.AbstractElement
Returns:
the object associated with this report element (may be null)

insertTier

public void insertTier(int tierType,
                       int index,
                       boolean insertBefore,
                       java.lang.Object tierObject,
                       java.lang.String styleName)

insertTiers

public void insertTiers(int tierType,
                        int index,
                        boolean insertBefore,
                        java.util.List objects,
                        java.util.List styleNames)

setTierPrototype

public void setTierPrototype(int tierType,
                             int index,
                             Element prototypeElement,
                             java.lang.String prototypeStyleName)

setCell

public AbstractReport.DefaultTableElement.DefaultCellElement setCell(int rowIndex,
                                                                     int columnIndex,
                                                                     Element cellContentElement,
                                                                     java.lang.String cellStyleName)
Throws:
java.lang.IndexOutOfBoundsException - if the number of rows is less than or equal to rowIndex; if the number of columns is less than or equal to columnIndex

setCell

public AbstractReport.DefaultTableElement.DefaultCellElement setCell(int startRowIndex,
                                                                     int startColumnIndex,
                                                                     int endRowIndex,
                                                                     int endColumnIndex,
                                                                     Element cellElement,
                                                                     java.lang.String cellStyleName)

setFooterTierCount

public void setFooterTierCount(int tierType,
                               int count)

setHeaderTierCount

public void setHeaderTierCount(int tierType,
                               int count)

getCellAt

public CellElement getCellAt(int rowIndex,
                             int columnIndex)
Description copied from interface: TableElement
Returns the cell at the specified location.

Specified by:
getCellAt in interface TableElement
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


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