|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.storage.StringKeyValueSQLiteStore
public class StringKeyValueSQLiteStore
Allows a key-value pairs to be stored to a SQLite database through the Android APIs.
Nested Class Summary | |
---|---|
class |
StringKeyValueSQLiteStore.DatabaseHelper
Helps on creating and upgrading the SQLite db. |
Constructor Summary | |
---|---|
StringKeyValueSQLiteStore(Context c,
java.lang.String dbName,
java.lang.String tableName)
Create a new StringKeyValueSQLiteStore given the
Context the database file name and the table name. |
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 method. |
java.lang.String |
remove(java.lang.String key)
Removes an entry from the store |
void |
reset()
Resets this data store. |
void |
save()
Save the current store. |
void |
update(java.lang.String key,
java.lang.String value)
Update and existing item into the store. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringKeyValueSQLiteStore(Context c, java.lang.String dbName, java.lang.String tableName)
StringKeyValueSQLiteStore
given the
Context
the database file name and the table name.
c
- The Context
.dbName
- The database file name.tableName
- The table name.Method Detail |
---|
public void add(java.lang.String key, java.lang.String value)
StringKeyValueStore
add
in interface StringKeyValueStore
key
- the unique key for this item (cannot be null)value
- the value to be storedStringKeyValueStore.add(java.lang.String, java.lang.String)
public void update(java.lang.String key, java.lang.String value)
StringKeyValueStore
update
in interface StringKeyValueStore
key
- the unique key of the existing itemvalue
- the value to be storedStringKeyValueStore.update(java.lang.String, java.lang.String)
public java.lang.String put(java.lang.String key, java.lang.String value) throws java.lang.Exception
put
in interface StringKeyValueStore
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 performedpublic java.lang.String get(java.lang.String key)
StringKeyValueStore
get
in interface StringKeyValueStore
key
- is the key (cannot be null)
StringKeyValueStore.get(java.lang.String)
public java.util.Enumeration keys()
StringKeyValueStore
String
.
keys
in interface StringKeyValueStore
StringKeyValueStore.keys()
public java.util.Enumeration keyValuePairs()
StringKeyValueStore
KeyValuePair
.
keyValuePairs
in interface StringKeyValueStore
StringKeyValueStore.keyValuePairs()
public boolean contains(java.lang.String key)
StringKeyValueStore
contains
in interface StringKeyValueStore
StringKeyValueStore.contains(java.lang.String)
public java.lang.String remove(java.lang.String key)
StringKeyValueStore
remove
in interface StringKeyValueStore
key
- the item key
StringKeyValueStore.remove(java.lang.String)
public void save() throws java.io.IOException
save
in interface StringKeyValueStore
java.io.IOException
- if the operation cannot be performedStringKeyValueStore.save()
public void load() throws java.io.IOException
StringKeyValueStore
load
in interface StringKeyValueStore
java.io.IOException
- if the operation cannot be performedStringKeyValueStore.load()
public void reset() throws java.io.IOException
StringKeyValueStore
reset
in interface StringKeyValueStore
java.io.IOException
- if the operation failsStringKeyValueStore.reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |