Slide 4.11: Line-by-line anatomy of RecordStore project (cont.)
  Slide 4.13: Line-by-line anatomy of RecordStore project (cont.)
  Home


Line-by-line Anatomy of RecordStore Project (Cont.)


byte[ ] raw = re.nextRecord( );
The method public byte[ ] javax.microedition.rms.RecordEnumeration.nextRecord returns a copy of the next record in this enumeration, where next is defined by the comparator and/or filter supplied in the constructor of this enumerator. The byte array returned is a copy of the record. Any changes made to this array will NOT be reflected in the record store. After calling this method, the enumeration is advanced to the next available record.

re.destroy( );
The method public void javax.microedition.rms.RecordEnumeration.destroy frees internal resources used by this RecordEnumeration. MIDlets should call this method when they are done using a RecordEnumeration. If a MIDlet tries to use a RecordEnumeration after this method has been called, it will throw a IllegalStateException.

rs.closeRecordStore( );
The method public void javax.microedition.rms.RecordStore.closeRecordStore( ) is called when the MIDlet requests to have the record store closed. int id = re.nextRecordId( );
The method public int javax.microedition.rms.RecordEnumeration.nextRecordId( ) returns the recordId of the next record in this enumeration, where next is defined by the comparator and/or filter supplied in the constructor of this enumerator.