Line-by-line Anatomy of RecordStore
Project (Cont.)
re = rs.enumerateRecords( null, null, false );
The method public RecordEnumeration enumerateRecords(RecordFilter filter, RecordComparator comparator, boolean keepUpdated) returns an enumeration for traversing a set of records in the record store in an optionally specified order.
filter
— if non-null, will be used to determine what subset of the record store records will be used.
comparator
— if non-null, will be used to determine the order in which the records are returned.
keepUpdated
—
- If true, the enumerator will keep its enumeration current with any changes in the records of the record store.
- If false, the enumeration will not be kept current and may return
recordId
s for records that have been deleted or miss records that are added later.
If both the filter
and comparator
are null
, the enumeration will traverse all records in the record store 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.
re.hasNextElement( )
The method public boolean javax.microedition.rms.RecordEnumeration.hasNextElement returns true if more elements exist in the next
direction.