K - The type of the key used to identify objects into the store.V - The type of the objects stored into the store. You can inform JavaScriptObject
to this type and insert any valid javascript object into the store. Different javascript objects can be inserted into the store.public interface ObjectStore<K,V>
| Modifier and Type | Method and Description |
|---|---|
void |
add(V object)
Insert the given object into the store.
|
void |
add(V object,
DatabaseWriteCallback<K> callback)
Insert the given object into the store.
|
void |
clear(DatabaseCallback callback)
Clear this object store
|
void |
count(DatabaseCountCallback callback)
Return the number of items stored into this object store.
|
void |
count(KeyRange<K> range,
DatabaseCountCallback callback)
Return the number of items stored into this object store in the given range.
|
void |
delete(K key)
Remove the object associated with the given key from the store.
|
void |
delete(K key,
DatabaseDeleteCallback callback)
Remove the object associated with the given key from the store.
|
void |
delete(KeyRange<K> keyRange)
Remove all the objects in the given range from the store.
|
void |
delete(KeyRange<K> keyRange,
DatabaseDeleteCallback callback)
Remove all the objects in the given range from the store.
|
void |
get(K key,
DatabaseRetrieveCallback<V> callback)
Retrieve the object associated with the given key from the store.
|
<I> Index<K,I,V> |
getIndex(String name)
Retrieve the index for the given name
|
String[] |
getIndexNames()
Return the names of the indexes associated with this object store.
|
KeyRangeFactory<K> |
getKeyRangeFactory()
Retrieve a factory to create KeyRange objects used by this object store.
|
String |
getObjectStoreName()
Retrive the name associated with the storage.
|
boolean |
isAutoIncrement()
Return true if this object store auto increments its keys.
|
void |
openCursor(DatabaseCursorCallback<K,V> callback)
Open a cursor to iterate over the object store.
|
void |
openCursor(KeyRange<K> keyRange,
Cursor.CursorDirection direction,
DatabaseCursorCallback<K,V> callback)
Open a cursor to iterate over the object store.
|
void |
openCursor(KeyRange<K> keyRange,
DatabaseCursorCallback<K,V> callback)
Open a cursor to iterate over the object store.
|
void |
put(V object)
Update the given object into the storage.
|
void |
put(V object,
DatabaseWriteCallback<K> callback)
Update the given object into the storage.
|
String getObjectStoreName()
void add(V object)
object - void add(V object, DatabaseWriteCallback<K> callback)
object - callback - void put(V object)
object - void put(V object, DatabaseWriteCallback<K> callback)
object - callback - void get(K key, DatabaseRetrieveCallback<V> callback)
DatabaseRetrieveCallback.key - callback - void delete(K key)
key - void delete(K key, DatabaseDeleteCallback callback)
key - callback - void delete(KeyRange<K> keyRange)
keyRange - void delete(KeyRange<K> keyRange, DatabaseDeleteCallback callback)
keyRange - callback - String[] getIndexNames()
boolean isAutoIncrement()
void clear(DatabaseCallback callback)
callback - void openCursor(DatabaseCursorCallback<K,V> callback)
callback - void openCursor(KeyRange<K> keyRange, DatabaseCursorCallback<K,V> callback)
keyRange - callback - void openCursor(KeyRange<K> keyRange, Cursor.CursorDirection direction, DatabaseCursorCallback<K,V> callback)
keyRange - direction - callback - void count(DatabaseCountCallback callback)
callback - void count(KeyRange<K> range, DatabaseCountCallback callback)
range - callback - <I> Index<K,I,V> getIndex(String name)
name - KeyRangeFactory<K> getKeyRangeFactory()
Copyright © 2015. All rights reserved.