|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mobileservices.isync.midp.FastRecordStore
A class that builds on top of the basic RecordStore class to provide performance improvements for writes (by providing a write buffer) as well as update, delete and find by primary key methods.
FastRecordEnumeration
,
Index
,
IndexException
Method Summary | |
void |
closeRecordStore()
Writes out meta data to the first row of the RMS table before it closes itself down. |
static void |
deleteRecordStore(java.lang.String recordStoreName)
Deletes the RecordStore |
com.ibm.mobileservices.isync.midp.FastRecordEnumeration |
enumerateRecords(javax.microedition.rms.RecordFilter filter,
javax.microedition.rms.RecordComparator comparator,
boolean keepUpdated)
Return a new enumeration over the current FastRecordStore instance. |
long |
getLastModified()
Return the time the record store was last modified |
java.lang.String |
getName()
Get the name of this record store |
short |
getNextRecordID()
Return the next available record ID, if one is inserted. |
int |
getNumRecords()
Get the number of records in this store |
byte[] |
getRecord(int recordId)
Returns a copy of the data stored in targetRecord, creating a new byte array each time. |
int |
getRecord(int targetRecord,
byte[] buffer,
int offset)
Returns a row from the record store. |
int |
getRecordSize(int recordId)
Returns the size (in bytes) of a record, used by the MIDLet to ensure that a byte[] is large enough to hold the row when using getRecord(int, byte[], int). |
int |
getSizeAvailable()
Get the number of bytes available for this record store to grow. |
static com.ibm.mobileservices.isync.midp.FastRecordStore |
openRecordStore(java.lang.String recordStoreName,
boolean createIfNecessary)
Returns an instance of FastRecordStore. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public short getNextRecordID()
public int getRecordSize(int recordId) throws javax.microedition.rms.RecordStoreNotOpenException, javax.microedition.rms.InvalidRecordIDException, javax.microedition.rms.RecordStoreException, java.io.IOException
Returns the size (in bytes) of a record, used by the MIDLet to ensure that a byte[] is large enough to hold the row when using getRecord(int, byte[], int).
recordId
- The record whose size we want
javax.microedition.rms.InvalidRecordIDException
- if there are no more records to return
javax.microedition.rms.RecordStoreNotOpenException
- if the record store is not open.
javax.microedition.rms.RecordStoreException
- general exception
java.io.IOException
- internal error processing rowpublic byte[] getRecord(int recordId) throws javax.microedition.rms.RecordStoreNotOpenException, javax.microedition.rms.InvalidRecordIDException, javax.microedition.rms.RecordStoreException, java.io.IOException
Returns a copy of the data stored in targetRecord, creating a new byte array each time. More efficient to use getRecord( int, byte[], int) and reuse the byte array.
recordId
- the record of interest
javax.microedition.rms.InvalidRecordIDException
- if there are no more records to return
javax.microedition.rms.RecordStoreNotOpenException
- if the record store is not open.
javax.microedition.rms.RecordStoreException
- general exception
java.io.IOException
- internal error reading row datapublic int getRecord(int targetRecord, byte[] buffer, int offset) throws javax.microedition.rms.RecordStoreNotOpenException, javax.microedition.rms.InvalidRecordIDException, javax.microedition.rms.RecordStoreException
Returns a row from the record store.
targetRecord
- Record of interest.buffer
- In which to put the bytes, must be large enoughoffset
- ignored
javax.microedition.rms.InvalidRecordIDException
- if there are no more records to return
javax.microedition.rms.RecordStoreNotOpenException
- if the record store is not open.
javax.microedition.rms.RecordStoreException
- general exceptionpublic static com.ibm.mobileservices.isync.midp.FastRecordStore openRecordStore(java.lang.String recordStoreName, boolean createIfNecessary) throws javax.microedition.rms.RecordStoreException, javax.microedition.rms.RecordStoreFullException, javax.microedition.rms.RecordStoreNotFoundException, java.lang.Exception
javax.microedition.rms.InvalidRecordIDException
- if there are no more records to return
javax.microedition.rms.RecordStoreFullException
- no more space to create a new
record store.
javax.microedition.rms.RecordStoreNotFoundException
- if createIfNecessary
is false, and the record store is not found.
javax.microedition.rms.RecordStoreException
- general exception
java.lang.Exception
- internal errorpublic static void deleteRecordStore(java.lang.String recordStoreName) throws javax.microedition.rms.RecordStoreException, javax.microedition.rms.RecordStoreNotFoundException
recordStoreName
- The name of the record store to delete.
javax.microedition.rms.RecordStoreNotFoundException
- if the record store is not open.
javax.microedition.rms.RecordStoreException
- general exceptionIndex.delete(String)
public long getLastModified() throws javax.microedition.rms.RecordStoreNotOpenException
javax.microedition.rms.RecordStoreNotOpenException
- if the record store is not open.public void closeRecordStore() throws javax.microedition.rms.RecordStoreException, javax.microedition.rms.RecordStoreNotOpenException
javax.microedition.rms.RecordStoreNotOpenException
- if the record store is not open.
javax.microedition.rms.RecordStoreException
- general exceptionpublic com.ibm.mobileservices.isync.midp.FastRecordEnumeration enumerateRecords(javax.microedition.rms.RecordFilter filter, javax.microedition.rms.RecordComparator comparator, boolean keepUpdated)
filter
- ignoredcomparator
- ignoredkeepUpdated
- ignored
public int getSizeAvailable() throws javax.microedition.rms.RecordStoreException
javax.microedition.rms.RecordStoreException
public int getNumRecords()
public java.lang.String getName()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |