|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.storage.ObjectStore
public class ObjectStore
This class uses the J2ME RMS to store and retrieve objects using the rms positional access. To persist an object using ObjectStore, it must implement the com.funambol.storage.Serializable interface.
Constructor Summary | |
---|---|
ObjectStore()
Creates a new instance of ObjectStore. |
Method Summary | |
---|---|
void |
addStoreListener(ObjectStoreListener listener)
Add a RecordListener to the recordStore |
void |
close()
Close the current RecordStore, if open. |
boolean |
create(java.lang.String name)
Creates a new RecordStore, or open an existing one. |
int |
getAvaliableStorage()
Returns the amount of additional room (in bytes) available for this record store to grow. |
int |
getFirstIndex()
Get the first valid index in the record store. |
java.lang.String |
getName()
|
int |
getNextIndex()
Get the next valid index in the record store. |
java.util.Enumeration |
getObjects(Serializable s)
Get all object of the ObjectStore |
boolean |
open(java.lang.String name)
Open an existing RecordStore, or throws an exception if not present. |
void |
remove(int index)
Remove the object from the store. |
void |
removeObjectComparator()
Set Comparator for this ObjectStore |
void |
removeObjectFilter()
Remove Filter after usage |
void |
removeStoreListener(ObjectStoreListener listener)
Add a RecordListener to the recordStore |
Serializable |
retrieve(int index,
Serializable obj)
Retrieve the serialize object from the record store. |
void |
setObjectComparator(ObjectComparator newOc)
Set Comparator for this ObjectStore |
void |
setObjectFilter(ObjectFilter newOf)
Set Filter for this ObjectStore |
int |
size()
Return the number of records in this ObjectStore |
int |
store(int index,
Serializable obj)
Store the serializable object in an existent record. |
int |
store(Serializable obj)
Store the serializable object in a new record. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectStore()
Method Detail |
---|
public java.util.Enumeration getObjects(Serializable s)
s
- Serializable Object to be returned
public java.lang.String getName() throws javax.microedition.rms.RecordStoreNotOpenException
javax.microedition.rms.RecordStoreNotOpenException
public boolean open(java.lang.String name) throws javax.microedition.rms.RecordStoreException
name
- is the name of the RecordStore to be managed
javax.microedition.rms.RecordStoreException
public boolean create(java.lang.String name) throws javax.microedition.rms.RecordStoreException
name
- is the name of the RecordStore to be managed
javax.microedition.rms.RecordStoreException
public void close() throws javax.microedition.rms.RecordStoreException
javax.microedition.rms.RecordStoreException
public int size()
public int getFirstIndex() throws javax.microedition.rms.RecordStoreException
javax.microedition.rms.RecordStoreException
public int getNextIndex() throws javax.microedition.rms.RecordStoreException
javax.microedition.rms.RecordStoreException
public int store(Serializable obj) throws javax.microedition.rms.RecordStoreException, java.io.IOException
obj
- the serializable object
javax.microedition.rms.RecordStoreException
java.io.IOException
public int store(int index, Serializable obj) throws javax.microedition.rms.RecordStoreException, java.io.IOException
obj
- the serializable object
javax.microedition.rms.RecordStoreException
java.io.IOException
public Serializable retrieve(int index, Serializable obj) throws javax.microedition.rms.RecordStoreException, java.io.IOException
obj
- the serializable objectindex
- the index in the recordstore
javax.microedition.rms.RecordStoreException
java.io.IOException
public void remove(int index) throws javax.microedition.rms.RecordStoreException
index
- the index in the recordstore
javax.microedition.rms.RecordStoreException
public int getAvaliableStorage()
public void addStoreListener(ObjectStoreListener listener)
public void removeStoreListener(ObjectStoreListener listener)
public void setObjectFilter(ObjectFilter newOf)
public void removeObjectFilter()
public void setObjectComparator(ObjectComparator newOc)
public void removeObjectComparator()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |