org.jfree.report
Class TableReportData

java.lang.Object
  extended by org.jfree.report.TableReportData
All Implemented Interfaces:
DataSet, ReportData

public class TableReportData
extends java.lang.Object
implements ReportData

Creation-Date: 19.02.2006, 17:00:10

Author:
Thomas Morgner

Field Summary
 
Fields inherited from interface org.jfree.report.ReportData
BEFORE_FIRST_ROW
 
Constructor Summary
TableReportData(javax.swing.table.TableModel tableModel)
           
TableReportData(javax.swing.table.TableModel tableModel, int start, int length)
           
 
Method Summary
 void close()
          Closes the datasource.
 java.lang.Object get(int column)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int column)
           
 int getCursorPosition()
           
 boolean isAdvanceable()
          This operation checks, whether a call to next will be likely to succeed.
 boolean isReadable()
          Checks, whether this report-data instance is currently readable.
 boolean next()
          This method produces the same result as 'setCursorPosition(getCursorPosition() + 1);'
 boolean setCursorPosition(int row)
          Moves the cursor back to an already visited position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableReportData

public TableReportData(javax.swing.table.TableModel tableModel)

TableReportData

public TableReportData(javax.swing.table.TableModel tableModel,
                       int start,
                       int length)
Method Detail

getColumnCount

public int getColumnCount()
                   throws DataSourceException
Specified by:
getColumnCount in interface DataSet
Throws:
DataSourceException

isReadable

public boolean isReadable()
                   throws DataSourceException
Description copied from interface: ReportData
Checks, whether this report-data instance is currently readable. A report-data instance cannot be readable if it is positioned before the first row. (The look-ahead system of 'isAdvanceable()' will prevent that the datasource is positioned behind the last row.)

Specified by:
isReadable in interface ReportData
Returns:
true, if the datarow is valid, false otherwise.
Throws:
DataSourceException

setCursorPosition

public boolean setCursorPosition(int row)
                          throws DataSourceException
Description copied from interface: ReportData
Moves the cursor back to an already visited position. Calling this method for an row number that has not yet been read using 'next' is undefined, whether that call succeeds is implementation dependent. Calls to position zero (aka BEFORE_FIRST_ROW) will always succeeed (unless there is a physical error, which invalidated the whole report-data object).

Specified by:
setCursorPosition in interface ReportData
Returns:
true, if moving the cursor succeeded, false otherwise.
Throws:
DataSourceException

isAdvanceable

public boolean isAdvanceable()
                      throws DataSourceException
This operation checks, whether a call to next will be likely to succeed. If there is a next data row, this should return true.

Specified by:
isAdvanceable in interface ReportData
Returns:
Throws:
DataSourceException

getColumnName

public java.lang.String getColumnName(int column)
                               throws DataSourceException
Specified by:
getColumnName in interface DataSet
Throws:
DataSourceException

get

public java.lang.Object get(int column)
                     throws DataSourceException
Specified by:
get in interface DataSet
Throws:
DataSourceException

next

public boolean next()
             throws DataSourceException
Description copied from interface: ReportData
This method produces the same result as 'setCursorPosition(getCursorPosition() + 1);'

Specified by:
next in interface ReportData
Returns:
Throws:
DataSourceException

close

public void close()
           throws DataSourceException
Description copied from interface: ReportData
Closes the datasource. This should be called at the end of each report processing run. Whether this closes the underlying data-source backend depends on the ReportDataFactory. Calling 'close()' on the ReportDataFactory *must* close all report data objects.

Specified by:
close in interface ReportData
Throws:
DataSourceException

getCursorPosition

public int getCursorPosition()
                      throws DataSourceException
Specified by:
getCursorPosition in interface ReportData
Throws:
DataSourceException