|
||||||||||
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.
Field Summary | |
---|---|
protected java.lang.Object |
mutex
|
protected java.lang.String |
name
|
protected AbstractRecordStore |
rs
|
Constructor Summary | |
---|---|
ObjectStore()
Creates a new instance of ObjectStore. |
|
ObjectStore(java.lang.String name)
Creates a new instance of ObjectStore given the record store name. |
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 |
createEmptyRecord()
Creates an empty record. |
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()
Open the current RecordStore, or throws an exception if not present. |
boolean |
open(java.lang.String name)
Open an existing RecordStore, or throws an exception if not present. |
protected boolean |
openStore()
private method used by open and create to share code. |
protected boolean |
openStore(java.lang.String name,
boolean create)
private method used by open and create to share code. |
void |
remove()
Removes this object store. |
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. |
java.io.DataInputStream |
retrieveBytes(int index)
Retrieve the DataInputStream corresponding to a record. |
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 |
Field Detail |
---|
protected AbstractRecordStore rs
protected final java.lang.Object mutex
protected java.lang.String name
Constructor Detail |
---|
public ObjectStore()
public ObjectStore(java.lang.String name)
Method Detail |
---|
public java.util.Enumeration getObjects(Serializable s)
s
- Serializable Object to be returned
public java.lang.String getName()
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 open() throws javax.microedition.rms.RecordStoreException
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
protected boolean openStore(java.lang.String name, boolean create) throws javax.microedition.rms.RecordStoreException
javax.microedition.rms.RecordStoreException
protected boolean openStore() throws javax.microedition.rms.RecordStoreException
javax.microedition.rms.RecordStoreException
public void close() throws javax.microedition.rms.RecordStoreException
javax.microedition.rms.RecordStoreException
public void remove() 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 createEmptyRecord() throws javax.microedition.rms.RecordStoreException, java.io.IOException
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
- if the record is invalid
java.io.IOException
- if the store is not accessiblepublic java.io.DataInputStream retrieveBytes(int index) throws javax.microedition.rms.RecordStoreException, java.io.IOException
index
- the index in the record store
javax.microedition.rms.RecordStoreException
- if the record is invalid
java.io.IOException
- if the store is not accessiblepublic 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 |