jimm.datavision.source
Class DataCursor

java.lang.Object
  extended by jimm.datavision.source.DataCursor
Direct Known Subclasses:
CharSepRow, MockAggregateDataCursor, MockDataCursor, ObjectRow, ResultSetRow

public abstract class DataCursor
extends java.lang.Object

Represents a row of data. Provides the interface needed by Report, no more. When using JDBC, this is a wrapper around a ResultSet.

The only method subclasses must implement is readRowData().

Author:
Jim Menard, jimm@io.com

Field Summary
protected  java.util.List currRowData
           
protected  int currRowNumber
           
protected  java.util.List lastRowData
           
protected  int lastRowNumber
           
protected  java.util.List nextRowData
           
protected  java.util.List prevRowData
           
 
Constructor Summary
DataCursor()
           
 
Method Summary
 void close()
           
 java.lang.Object getObject(int index)
          Returns the object in the specified column.
 int getRow()
           
 boolean isFirst()
           
 boolean isLast()
           
 boolean last()
           
 boolean next()
           
 boolean previous()
           
protected abstract  java.util.List readRowData()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currRowNumber

protected int currRowNumber

prevRowData

protected java.util.List prevRowData

currRowData

protected java.util.List currRowData

nextRowData

protected java.util.List nextRowData

lastRowData

protected java.util.List lastRowData

lastRowNumber

protected int lastRowNumber
Constructor Detail

DataCursor

public DataCursor()
Method Detail

isFirst

public boolean isFirst()

isLast

public boolean isLast()

next

public boolean next()

previous

public boolean previous()

last

public boolean last()

getRow

public int getRow()

close

public void close()

getObject

public java.lang.Object getObject(int index)
Returns the object in the specified column. index starts at 1.

Even when running a report, currRowData is not always defined. For example, when a query returns zero rows but a column field is in some header or footer, this method is called but currRowData is null. If it is, we return null.

Returns:
the object in the index'th column, or null if no data has yet been read

readRowData

protected abstract java.util.List readRowData()