O'Reilly logo

J2ME in a Nutshell by Kim Topley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required