Name

RecordEnumeration

Synopsis

RecordEnumeration is an interface that provides method to enumerate, or iterate, through a set of records in a RecordStore. The RecordEnumeration may be constructed so that only a subset of the records appear. In addition, it may also specify the order in which the records are presented. Once the enumeration has been constructed, records may be traversed either forwards or backwards, and the traversal direction may be changed at any time.

A RecordEnumeration is obtained by calling the RecordStore enumerateRecords() method, which accepts three parameters that determine the content and ordering of the enumeration:

filter

A RecordFilter that selects which records will appear in the enumeration. If this argument is null, the enumeration will include all of the records.

comparator

A RecordComparator that determines the order in which the records appear in the enumeration. If this parameter is null, the record order is undefined.

keepUpdated

If this parameter has the value false, the set of records that appears in the enumeration, as well as their order, is determined once and is thereafter fixed, even if the underlying RecordStore content changes. If this parameter is true, changes in the RecordStore will be immediately visible in the enumeration. Note that setting this parameter to true can be very expensive as each change to the RecordStore requires a potentially time-consuming operation to rebuild the enumeration.

Once an enumeration has been created, ...

Get J2ME in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.