|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StringKeyValueStore
This interface defines a generic data store for strings where data is orgnized as key/value pair. The store is persistable and each implementation is free to choose where and how data is persisted. Note that the lack of serializable concept in jme prevents this store to be more generic. The Funambol APIs have the notion of Serializable but that interface is not implemented by String, so it would be coumbersome to have a simple KeyValueStore for strings.
Method Summary | |
---|---|
void |
add(java.lang.String key,
java.lang.String value)
Add a new item into the store. |
boolean |
contains(java.lang.String key)
Returns true iff key is contained in this store. |
java.lang.String |
get(java.lang.String key)
Returns the value associated to the given key or null if not present. |
java.util.Enumeration |
keys()
Returns an enumeration with all the keys in the store. |
java.util.Enumeration |
keyValuePairs()
Returns an enumeration of all the key/value pairs in the store. |
void |
load()
Load this store into memory. |
java.lang.String |
put(java.lang.String key,
java.lang.String value)
Deprecated. Use add and update methods instead. |
java.lang.String |
remove(java.lang.String key)
Removes an entry from the store |
void |
reset()
Resets this data store. |
void |
save()
Persist this store. |
void |
update(java.lang.String key,
java.lang.String value)
Update and existing item into the store. |
Method Detail |
---|
void add(java.lang.String key, java.lang.String value)
key
- the unique key for this item (cannot be null)value
- the value to be storedvoid update(java.lang.String key, java.lang.String value)
key
- the unique key of the existing itemvalue
- the value to be storedjava.lang.String put(java.lang.String key, java.lang.String value) throws java.lang.Exception
key
- the unique key for this item (cannot be null)value
- the value to be stored
java.lang.Exception
- if the operation can't be performedjava.lang.String get(java.lang.String key)
key
- is the key (cannot be null)
java.util.Enumeration keys()
String
.
java.util.Enumeration keyValuePairs()
KeyValuePair
.
boolean contains(java.lang.String key)
java.lang.String remove(java.lang.String key)
key
- the item key
void save() throws java.io.IOException
java.io.IOException
- if the operation cannot be performedvoid load() throws java.io.IOException
java.io.IOException
- if the operation cannot be performedvoid reset() throws java.io.IOException
java.io.IOException
- if the operation fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |