Package net.sf.statcvs.reportmodel
Class GenericColumn
java.lang.Object
net.sf.statcvs.reportmodel.Column
net.sf.statcvs.reportmodel.GenericColumn
- Direct Known Subclasses:
AuthorColumn
,AuthorIdColumn
,DirectoryColumn
,FileColumn
,SimpleTextColumn
A generic column with a text header and a text total. Each cell contains
an Object. The renderCell method must be implemented by subclasses.
- Version:
- $Id: GenericColumn.java,v 1.2 2008/04/02 11:22:14 benoitx Exp $
- Author:
- Richard Cyganiak invalid input: '<'rcyg@gmx.de>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a value to this column (in a new row)int
getRows()
Return number of rows that have been added to this columngetValue
(int rowIndex) Returns a value of the columnabstract void
renderCell
(int rowIndex, TableCellRenderer renderer) Renders a row of the column into a TableCellRenderer by calling one of itsTableCellRenderer.renderCell(java.lang.String)
methodsvoid
renderHead
(TableCellRenderer renderer) Renders the head of the column into a TableCellRenderer by calling one of itsTableCellRenderer.renderCell(java.lang.String)
methodsvoid
renderTotal
(TableCellRenderer renderer) Renders the footer of the column into a TableCellRenderer by calling one of itsTableCellRenderer.renderCell(java.lang.String)
methods.void
Sets the total for this column
-
Constructor Details
-
GenericColumn
Creates a new GenericColumn with the given head- Parameters:
title
- the head of the column
-
-
Method Details
-
setTotal
Sets the total for this column- Parameters:
value
- the total for this column
-
addValue
Adds a value to this column (in a new row)- Parameters:
value
- the new value
-
getValue
Returns a value of the column- Parameters:
rowIndex
- the row, starting at 0- Returns:
- the value
-
getRows
public int getRows()Description copied from class:Column
Return number of rows that have been added to this column -
renderHead
Description copied from class:Column
Renders the head of the column into a TableCellRenderer by calling one of itsTableCellRenderer.renderCell(java.lang.String)
methods- Specified by:
renderHead
in classColumn
- Parameters:
renderer
- the TableCellRenderer to use TODO: this is probably unnecessary; better add a getTitle method- See Also:
-
renderCell
Description copied from class:Column
Renders a row of the column into a TableCellRenderer by calling one of itsTableCellRenderer.renderCell(java.lang.String)
methods- Specified by:
renderCell
in classColumn
- Parameters:
rowIndex
- the row number, starting at 0renderer
- the TableCellRenderer to use- See Also:
-
renderTotal
Description copied from class:Column
Renders the footer of the column into a TableCellRenderer by calling one of itsTableCellRenderer.renderCell(java.lang.String)
methods. The footer usually contains some kind of total for the column.- Specified by:
renderTotal
in classColumn
- Parameters:
renderer
- the TableCellRenderer to use- See Also:
-