Line-by-line Anatomy of RecordStore
Project (Cont.)
mHashtable.get( key )
The method public Object java.util.Hashtable.get(Object key) returns the value to which the specified key is mapped in this hashtable.
A value null
is returned if the key is not mapped to any value in this hashtable.
mHashtable.put( key, value );
The method public Object java.util.Hashtable.put(Object key, Object value) maps the specified key to the specified value in this hashtable.
RecordStore rs = null;
The class javax.microedition.rms.RecordStore representing a record store, which consists of a collection of records and remains persistent across multiple invocations of the MIDlet.
Platform is responsible for making its best effort to maintain the integrity of the MIDlet's record stores throughout the normal use of the platform, including reboots, battery changes, etc.
RecordEnumeration re = null;
The interface javax.microedition.rms.RecordEnumeration represents a bidirectional record store Record
enumerator.
The RecordEnumeration
logically maintains a sequence of the recordId
's of the records in a record store.
The enumerator will iterate over all of the records in an order determined by an optional record comparator.
- By using an optional
RecordFilter
, a subset of the records can be chosen that match the supplied filter.
- By using an optional
RecordComparator
, the enumerator can index through the records in an order determined by the comparator.
rs = RecordStore.openRecordStore( mRecordStoreName, true );
The method public static RecordStore openRecordStore(String recordStoreName, boolean createIfNecessary) opens (and possibly create) a record store associated with the given MIDlet suite. If this method is called by a MIDlet when the record store is already open by a MIDlet in the MIDlet suite, this method returns a reference to the same RecordStore object.