Returns an enumeration for traversing a set of records in the record store in an optionally specified order.
The filter, if non-null, will be used to determine what subset of the record store records will be used.
The comparator, if non-null, will be used to determine the order in which the records are returned.
If both the filter and comparator is null, the enumeration will traverse all records in the record store in an undefined order. This is the most efficient way to traverse all of the records in a record store. If a filter is used with a null comparator, the enumeration will traverse the filtered records in an undefined order. The first call to RecordEnumeration.nextRecord()
returns the record data from the first record in the sequence. Subsequent calls to RecordEnumeration.nextRecord()
return the next consecutive record's data. To return the record data from the previous consecutive from any given point in the enumeration, call previousRecord()
. On the other hand, if after creation the first call is to previousRecord()
, the record data of the last element of the enumeration will be returned. Each subsequent call to previousRecord()
will step backwards through the sequence.
@param filter if non-null, will be used to determine whatsubset of the record store records will be used
@param comparator if non-null, will be used to determine theorder in which the records are returned
@param keepUpdated if true, the enumerator will keep its enumerationcurrent with any changes in the records of the record store. Use with caution as there are possible performance consequences. If false the enumeration will not be kept current and may return recordIds for records that have been deleted or miss records that are added later. It may also return records out of order that have been modified after the enumeration was built. Note that any changes to records in the record store are accurately reflected when the record is later retrieved, either directly or through the enumeration. The thing that is risked by setting this parameter false is the filtering and sorting order of the enumeration when records are modified, added, or deleted.
@exception RecordStoreNotOpenException if the record store isnot open
@see RecordEnumeration#rebuild
@return an enumeration for traversing a set of records in therecord store in an optionally specified order