org.jcreme.reporting
Interface Report

All Known Subinterfaces:
ModifiableReport
All Known Implementing Classes:
ProcessInfoReport

public interface Report

This class enables to describe a report that is presented as a table. This interface makes it quick and easy to plug a report in a TableModel. Classes that implement this interface should be careful not to reference any GUI class or object, so that they can be used in a graphic free environment (such as a unix webserver for instance).

Version:
$Revision: 1.2 $
Author:
$Author: dbregeon $

Method Summary
 void addReportChangeListener(ReportChangeListener listener)
          Adds a listener to the report.
 void clear()
          This method enables to clear the report lines.
 java.lang.Class getColumnClass(int columnIndex)
          This method enables to access the class of the objects returned by the getValueAt for this column.
 int getColumnCount()
          This enables to know the range of values for the column indexes.
 int getColumnIndex(java.lang.String columnName)
          This method enables to get the column index from its name.
 java.lang.String getColumnName(int index)
          This is a convenience method to recover the name of the column from its index.
 java.lang.String[] getColumnNames()
          This method enables to get the names of the columns present in the Report.
 ReportFilter getFilter()
          This methods returns a filter to apply to this report.
 int getRowCount()
          This enables to know the range of values for the row indexes.
 java.lang.String getTitle()
          This method enables to access the title of the Report.
 java.lang.Object getValueAt(int row, int column)
          This method gives access to the value at the given row and column for this report.
 void removeReportChangeListener(ReportChangeListener listener)
          Removes a listener from the list.
 void setFilter(ReportFilter filter)
          This method enables to change the filter that applies to this report.
 

Method Detail

getTitle

public java.lang.String getTitle()
This method enables to access the title of the Report. This title may change when the filter changes.

Returns:
the title of the Report.

getColumnNames

public java.lang.String[] getColumnNames()
This method enables to get the names of the columns present in the Report.

Returns:
the column names of the report.

getColumnIndex

public int getColumnIndex(java.lang.String columnName)
This method enables to get the column index from its name. This is necessary since values must be accessed by row index and column index.

Parameters:
columnName - the name of the column for which we search the index.
Returns:
the particular index of a column.

getColumnName

public java.lang.String getColumnName(int index)
This is a convenience method to recover the name of the column from its index.

Parameters:
index - the index of the column for which we search the name.
Returns:
the name of a column at a particular index.

getColumnCount

public int getColumnCount()
This enables to know the range of values for the column indexes.

Returns:
the number of columns in the report.

getRowCount

public int getRowCount()
This enables to know the range of values for the row indexes.

Returns:
the number of rows in the report.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
This method gives access to the value at the given row and column for this report.

Parameters:
row - the row for which we want a value.
column - the column for which we want a value.
Returns:
the value in the report for the particular row and the particular column.

addReportChangeListener

public void addReportChangeListener(ReportChangeListener listener)
Adds a listener to the report.

Parameters:
listener - the listener that will receive ReportChangeEvents.

removeReportChangeListener

public void removeReportChangeListener(ReportChangeListener listener)
Removes a listener from the list.

Parameters:
listener - the listener to remove from the list of listeners on this report.

clear

public void clear()
This method enables to clear the report lines.


getFilter

public ReportFilter getFilter()
This methods returns a filter to apply to this report. It is not defined whether this filter must be applied outside the report when data is added or if the report uses the filter directly.

Returns:
the filter currently applied to that report.

setFilter

public void setFilter(ReportFilter filter)
This method enables to change the filter that applies to this report.

Parameters:
filter - the new filter to use on this report.

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
This method enables to access the class of the objects returned by the getValueAt for this column. This method reflects the TableModel method.

Parameters:
columnIndex - the index of the queried column.
Returns:
the class of the objects in a particular column. Objects can actually be of a subclass of the returned class.


Copyright 2006 null. All Rights Reserved.