com.crystaldecisions.sdk.occa.report.application
Class RowsetCursor

java.lang.Object
  extended by com.crystaldecisions.sdk.occa.report.application.RowsetCursor
All Implemented Interfaces:
ICursor

public class RowsetCursor
extends java.lang.Object
implements ICursor

This object provides easy access to records in a rowset. Create the cursor with the RowsetController object's createCursor method.


Method Summary
 void addNew()
           Reserved for future use.
 void delete()
           Reserved for future use.
 Record getCurrentRecord()
           Returns the current record value.
 int getCurrentRecordNumber()
           Returns the record number of the current cursor position.
 IGroupPath getGroupPath()
           Returns the group path used to create the rowset cursor.
 boolean getIsTotalRecordKnown()
           Returns true if the total number of records is known, and false otherwise.
 RowsetMetaData getMetaData()
           Returns the meta data used to create the rowset cursor.
 int getNumOfCachedBatches()
           Returns the number of batches cached in the rowset.
 int getRecordCount(FetchedRecordCountInfo info)
           Returns the number of records in the record batch.
 Rowset getRowset()
           Returns the records fetched from the server.
 RowsetController getRowsetController()
           Returns the RowsetController object that created this rowset cursor.
 boolean isEOF()
           Returns true if the cursor points to the last record, false otherwise.
 void moveFirst()
           Moves the cursor to the first record in the batch.
 void moveLast()
           Moves the cursor to the last record in the batch.
 boolean moveNext()
           Moves to the next record in the batch.
 boolean movePrevious()
           Moves to the previous record in the batch.
 boolean moveTo(int index)
           Moves to a specified record in the batch.
 void setNumOfCachedBatches(int val)
           Sets the default number of rowset batches that will be cached in the RowsetCursor.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addNew

public void addNew()
Description copied from interface: ICursor

Reserved for future use.

Specified by:
addNew in interface ICursor

delete

public void delete()
Description copied from interface: ICursor

Reserved for future use.

Specified by:
delete in interface ICursor

getCurrentRecord

public Record getCurrentRecord()

Returns the current record value.

Specified by:
getCurrentRecord in interface ICursor
Returns:
the Record object.

getCurrentRecordNumber

public int getCurrentRecordNumber()
                           throws ReportSDKException
Description copied from interface: ICursor

Returns the record number of the current cursor position.

Specified by:
getCurrentRecordNumber in interface ICursor
Returns:
An int that specifies the record number of the current cursor position.
Throws:
ReportSDKException

getGroupPath

public IGroupPath getGroupPath()

Returns the group path used to create the rowset cursor.

Returns:
The GroupPath object used to create this rowset cursor.

getIsTotalRecordKnown

public boolean getIsTotalRecordKnown()
Description copied from interface: ICursor

Returns true if the total number of records is known, and false otherwise.

Under certain circumstances, the total record count is not known:

If the value of this property is true, then the value of the getRecordCount method is the final total number of records.

Specified by:
getIsTotalRecordKnown in interface ICursor
Returns:
true if the total number of records is known, and false otherwise.

getMetaData

public RowsetMetaData getMetaData()

Returns the meta data used to create the rowset cursor.

Returns:
The RowsetMetaData object used to create this rowset cursor.

getNumOfCachedBatches

public int getNumOfCachedBatches()

Returns the number of batches cached in the rowset. This property overrides the number inherited from the RowsetController object's NumOfCachedBatches property.

Use this property to navigate a rowset. For example, suppose that RowsetBatchSize is 100, RecordCount is 500, and NumOfCachedBatches is 2.

Returns:
An int that specifies the number of batches cached in the rowset.
See Also:
setNumOfCachedBatches(int)

getRecordCount

public int getRecordCount(FetchedRecordCountInfo info)
Description copied from interface: ICursor

Returns the number of records in the record batch. If the value of getIsTotalRecordKnown() method is true, then the value returned by this method is the final total number of records. If the value of the getIsTotalRecordKnown() method is false, then this method returns an undefined result.

Specified by:
getRecordCount in interface ICursor
Parameters:
info - A FetchedRecordCountInfo object containing key properties of the fetched records.
Returns:
An int that specifies the number of records in the batch.

getRowset

public Rowset getRowset()
                 throws ReportSDKException

Returns the records fetched from the server.

Returns:
A Rowset object containing the records fetched from the server.
Throws:
ReportSDKException

getRowsetController

public RowsetController getRowsetController()

Returns the RowsetController object that created this rowset cursor.

Returns:
The RowsetController object that created this rowset cursor.

isEOF

public boolean isEOF()
Description copied from interface: ICursor

Returns true if the cursor points to the last record, false otherwise.

Specified by:
isEOF in interface ICursor
Returns:
true if the cursor points to the last record, false otherwise.

moveFirst

public void moveFirst()
               throws ReportSDKException
Description copied from interface: ICursor

Moves the cursor to the first record in the batch.

Specified by:
moveFirst in interface ICursor
Throws:
ReportSDKException

moveLast

public void moveLast()
              throws ReportSDKException
Description copied from interface: ICursor

Moves the cursor to the last record in the batch.

Specified by:
moveLast in interface ICursor
Throws:
ReportSDKException

moveNext

public boolean moveNext()
                 throws ReportSDKException
Description copied from interface: ICursor

Moves to the next record in the batch.

Specified by:
moveNext in interface ICursor
Returns:
true if the cursor advanced successfully, and false if the cursor already points to the last record in the batch.
Throws:
ReportSDKException

movePrevious

public boolean movePrevious()
                     throws ReportSDKException
Description copied from interface: ICursor

Moves to the previous record in the batch.

Specified by:
movePrevious in interface ICursor
Returns:
true if the cursor advanced successfully, and false if the cursor already points to the first record in the batch.
Throws:
ReportSDKException

moveTo

public boolean moveTo(int index)
               throws ReportSDKException
Description copied from interface: ICursor

Moves to a specified record in the batch. If you supply an index that is out of bounds the method will fail.

Specified by:
moveTo in interface ICursor
Parameters:
index - The index of the record in the batch. The batch is zero-based.
Returns:
true if there are more records after the index moved to, otherwise false. false will be returned when the move is to the last indexed record.
Throws:
ReportSDKException

setNumOfCachedBatches

public void setNumOfCachedBatches(int val)
                           throws ReportSDKException

Sets the default number of rowset batches that will be cached in the RowsetCursor. The RowsetCursor object created by createCursor method inherits this number. The default value is -1, which means that all batches will be cached. If you are iterating through a large data set, you may want to set this value to a positive integer. For example, if you set the value to 2, then only two batches will be kept in memory.

Parameters:
val - The number of rowset batches that will be cached in the RowsetCursor.
Throws:
ReportSDKException
See Also:
getNumOfCachedBatches()