com.ibm.mobileservices.isync.midp
Class FastRecordEnumeration

java.lang.Object
  |
  +--com.ibm.mobileservices.isync.midp.FastRecordEnumeration

public class FastRecordEnumeration
extends java.lang.Object

Enumerate over a FastRecordStore, provides a similar interface to javax.microedition.rms.FastRecordStore.

See Also:
FastRecordStore, Index

Method Summary
 void destroy()
          Frees internal resources used by this FastRecordEnumeration.
 boolean hasNextElement()
          More elements beyond our current location?
 boolean hasPreviousElement()
          More elements prior to our location?
 boolean isKeptUpdated()
          Not supported
 byte[] nextRecord()
          Returns a copy of the next record in this enumeration, where next is defined by the comparator and/or filter supplied in the constructor of this enumerator.
 int nextRecordId()
          Returns the recordId of the next record in this enumeration, where next is defined by the comparator and/or filter supplied in the constructor of this enumerator (comparators and filters not currently supported by FastRecordEnumeration).
 int numRecords()
          Returns the number of records available in this enumeration's set.
 byte[] previousRecord()
          Returns a copy of the previous record in this enumeration
 int previousRecordId()
          Returns the recordId of the previous record in this enumeration, where previous is defined by the comparator and/or filter supplied in the constructor of this enumerator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

destroy

public void destroy()
Frees internal resources used by this FastRecordEnumeration. A midlet should call this method when it is done with the enumeration.


hasNextElement

public boolean hasNextElement()
More elements beyond our current location?

Returns:
true if more elements exist in the next direction.

hasPreviousElement

public boolean hasPreviousElement()
More elements prior to our location?

Returns:
true if more elements exist in the previous direction.

isKeptUpdated

public boolean isKeptUpdated()
                      throws java.lang.Exception
Not supported

Throws:
java.lang.Exception - "Method not supported"

nextRecord

public byte[] nextRecord()
                  throws javax.microedition.rms.InvalidRecordIDException,
                         javax.microedition.rms.RecordStoreNotOpenException,
                         javax.microedition.rms.RecordStoreException,
                         java.lang.Exception
Returns a copy of the next record in this enumeration, where next is defined by the comparator and/or filter supplied in the constructor of this enumerator.

Returns:
the next record.
Throws:
javax.microedition.rms.InvalidRecordIDException - if there are no more records to return
javax.microedition.rms.RecordStoreNotOpenException - if the record store is not open.
javax.microedition.rms.RecordStoreException - general exception
java.lang.Exception - internal error

nextRecordId

public int nextRecordId()
                 throws javax.microedition.rms.InvalidRecordIDException
Returns the recordId of the next record in this enumeration, where next is defined by the comparator and/or filter supplied in the constructor of this enumerator (comparators and filters not currently supported by FastRecordEnumeration).

Returns:
the next record id
Throws:
javax.microedition.rms.InvalidRecordIDException - if there are no more records left.

numRecords

public int numRecords()
               throws java.lang.Exception
Returns the number of records available in this enumeration's set.

Throws:
java.lang.Exception - internal error

previousRecord

public byte[] previousRecord()
                      throws javax.microedition.rms.InvalidRecordIDException,
                             javax.microedition.rms.RecordStoreNotOpenException,
                             javax.microedition.rms.RecordStoreException,
                             java.lang.Exception
Returns a copy of the previous record in this enumeration

Throws:
javax.microedition.rms.InvalidRecordIDException - if there are no more records to return
javax.microedition.rms.RecordStoreNotOpenException - if the record store is not open.
javax.microedition.rms.RecordStoreException - general exception
java.lang.Exception - internal error

previousRecordId

public int previousRecordId()
                     throws javax.microedition.rms.InvalidRecordIDException
Returns the recordId of the previous record in this enumeration, where previous is defined by the comparator and/or filter supplied in the constructor of this enumerator.

Returns:
previous index
Throws:
javax.microedition.rms.InvalidRecordIDException - if there are no more records to return


(c) Copyright IBM Corp. 2001, 2002, 2003. All Rights Reserved.