Line-by-line Anatomy of RecordStore
Project (Cont.)
rs.deleteRecord( id );
The method public void javax.microedition.rms.RecordStore.deleteRecord(int recordId) deletes the record from the record store.
The recordId
for this record is NOT reused.
recordId
— the ID of the record to delete
Enumeration keys = mHashtable.keys( );
The method public Enumeration java.util.Hashtable.keys returns an java.util.Enumeration of the keys in this hashtable.
An object that implements the Enumeration
interface generates a series of elements, one at a time.
Successive calls to the nextElement
method return successive elements of the series.
keys.hasMoreElements( )
The method public boolean java.util.Enumeration.hasMoreElements( ) tests if this enumeration contains more elements.
keys.nextElement( )
The method public Object java.util.Enumeration.nextElement( ) returns the next element of this enumeration if this enumeration object has at least one more element to provide.
rs.addRecord( raw, 0, raw.length );
The method public int javax.microedition.rms.RecordStore.addRecord(byte[] data, int offset, int numBytes) adds a new record to the record store.
The recordId
for this new record is returned.
It is a blocking atomic operation.
The record is written to persistent storage before the method returns.
data
— the data to be stored in this record.
If the record is to have zero-length data (no data), this parameter may be null.
offset
— the index into the data buffer of the first byte for this record.
numBytes
— the number of bytes of the data buffer to use for this record.