|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--javax.microedition.rms.RecordStore
Incomplete Experimental Implementation
| Constructor Summary | |
RecordStore()
|
|
| Method Summary | |
abstract int |
addRecord(byte[] data,
int offset,
int count)
Adds a new record to the record store. |
abstract void |
addRecordListener(RecordListener listener)
Adds the specified RecordListener. |
abstract void |
closeRecordStore()
This method is called when the MIDlet requests to have the record store closed. |
abstract void |
deleteRecord(int recordId)
The record is deleted from the record store. |
static void |
deleteRecordStore(java.lang.String recordStoreName)
Deletes the named record store. |
abstract long |
getLastModified()
Returns the last time the record store was modified, in the format used by System.currentTimeMillis(). |
abstract java.lang.String |
getName()
Returns the name of this RecordStore. |
abstract int |
getNextRecordID()
Returns the recordId of the next record to be added to the record store. |
abstract int |
getNumRecords()
Returns the number of records currently in the record store. |
abstract byte[] |
getRecord(int recordId)
Returns a copy of the data stored in the given record. |
abstract int |
getRecord(int recordId,
byte[] buffer,
int offset)
Returns the data stored in the given record. |
abstract int |
getRecordSize(int recordId)
Returns the size (in bytes) of the application data available in the given record. |
abstract int |
getSize()
Returns the amount of space, in bytes, that the record store occupies. |
abstract int |
getSizeAvailable()
Returns the amount of additional room (in bytes) available for this record store to grow. |
abstract int |
getVersion()
Each time a record store is modified (record added, modified, deleted), it's version is incremented. |
static java.lang.String[] |
listRecordStores()
Returns an arry of names of record stores owned by the application if the stores are private. |
static RecordStore |
openRecordStore(java.lang.String recordStoreName,
boolean createIfNecessary)
Open (and possibly create) a record store. |
abstract void |
removeRecordListener(RecordListener listener)
Removes the specified RecordListener. |
abstract void |
setRecord(int recordId,
byte[] newData,
int offset,
int count)
Sets the data in the given record to that passed in. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RecordStore()
| Method Detail |
public abstract int addRecord(byte[] data,
int offset,
int count)
throws RecordStoreNotOpenException,
RecordStoreException,
RecordStoreFullException
data - The data to be stored in this record. If the record should
have zero-length - no data - this parameter may be set to nulloffset - The index of the data buffer of the first databyte for this
recordRecordStoreNotOpenException - if the record store is not yet open.InvalidRecordIDException - if the recordId is invalid.RecordStoreException - if a general recordstoreexception occurs.public abstract void addRecordListener(RecordListener listener)
listener - The RecordChangedListener
public abstract void closeRecordStore()
throws RecordStoreNotOpenException,
RecordStoreException
RecordStoreNotOpenException - if the record store is not openRecordStoreException - if another record store related Exception occurs
public abstract void deleteRecord(int recordId)
throws RecordStoreNotOpenException,
InvalidRecordIDException,
RecordStoreException
recordId - The ID of the record to be deletedRecordStoreNotOpenException - if the record store is not openRecordStoreException - if a different record store-related exception occurs
public static void deleteRecordStore(java.lang.String recordStoreName)
throws RecordStoreException,
RecordStoreNotFoundException
recordStoreName - The record store to be deletedRecordStoreNotFoundException - if the record store could not be found.RecordStoreException - if a record store related exception occurs.
public abstract long getLastModified()
throws RecordStoreNotOpenException
RecordStoreNotOpenException - if the record store is not open.
public abstract java.lang.String getName()
throws RecordStoreNotOpenException
RecordStoreNotOpenException - if the record store is not open.
public abstract int getNextRecordID()
throws RecordStoreNotOpenException,
RecordStoreException
RecordStoreNotOpenException - if the record store is not open.RecordStoreException - if another record store related exception occurs
public abstract int getNumRecords()
throws RecordStoreNotOpenException
RecordStoreNotOpenException - if the record store is not open.
public abstract byte[] getRecord(int recordId)
throws RecordStoreNotOpenException,
InvalidRecordIDException,
RecordStoreException
recordId - The ID of the record to use in this operationRecordStoreNotOpenException - if the record store is not open.InvalidRecordIDException - if the record store is invalid.RecordStoreException - if a general record store exception occurs.
public abstract int getRecord(int recordId,
byte[] buffer,
int offset)
throws RecordStoreNotOpenException,
InvalidRecordIDException,
RecordStoreException,
java.lang.ArrayIndexOutOfBoundsException
recordId - The ID of the record to be used in this operation.buffer - The byte array to copy the data.offset - The index index into the buffer i which to start copiying.RecordStoreNotOpenException - if the record store is not open.InvalidRecordIDException - if the record store is invalid.RecordStoreException - if a general record store exception occurs.java.lang.ArrayIndexOutOfBoundsException - if the record is larger that the buffer supplied
public abstract int getRecordSize(int recordId)
throws RecordStoreNotOpenException,
InvalidRecordIDException,
RecordStoreException
recordId - The ID of the record to be used in this operation.RecordStoreNotOpenException - if the record store is not open.InvalidRecordIDException - if the record store is invalid.RecordStoreException - if a general record store exception occurs.
public abstract int getSize()
throws RecordStoreNotOpenException
RecordStoreNotOpenException - if the record store is not open.
public abstract int getSizeAvailable()
throws RecordStoreNotOpenException
public abstract int getVersion()
throws RecordStoreNotOpenException
public static java.lang.String[] listRecordStores()
public static RecordStore openRecordStore(java.lang.String recordStoreName,
boolean createIfNecessary)
throws RecordStoreException,
RecordStoreFullException,
RecordStoreNotFoundException
recordStoreName - The unique name, not to exceed 32 characters, of the record store.createIfNecesarry - If true, the record store will be created if necessary.RecordStore object for the record store.RecordStoreException - if a record store-related exception occurs.RecordStoreNotFoundException - if the record store could not be foundpublic abstract void removeRecordListener(RecordListener listener)
listener - the RecordChangedListener
public abstract void setRecord(int recordId,
byte[] newData,
int offset,
int count)
throws RecordStoreNotOpenException,
InvalidRecordIDException,
RecordStoreException,
RecordStoreFullException
recordId - The ID of the record store.newdata - The new data buffer to store in the record.offset - The index into the data buffer of the first new byte to be stored in the record.count - The number of bytes of the data buffer to use for this record.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||