Package com.gengoai.kv
Class AbstractKeyValueStore<K,V>
- java.lang.Object
-
- com.gengoai.kv.AbstractKeyValueStore<K,V>
-
- Type Parameters:
K
- the type parameterV
- the type parameter
- All Implemented Interfaces:
KeyValueStore<K,V>
,Serializable
,AutoCloseable
,Map<K,V>
- Direct Known Subclasses:
AbstractNavigableKeyValueStore
,InMemoryKeyValueStore
public abstract class AbstractKeyValueStore<K,V> extends Object implements KeyValueStore<K,V>, Serializable
The type Abstract navigable key value store.- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractKeyValueStore(String namespace, boolean readOnly)
Instantiates a new Abstract navigable key value store.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(Object o)
boolean
containsValue(Object o)
protected abstract Map<K,V>
delegate()
Delegate navigable map.Set<Map.Entry<K,V>>
entrySet()
V
get(Object o)
String
getNameSpace()
Gets the namespace of the key-value storeboolean
isEmpty()
boolean
isReadOnly()
Is this key-value store read-only?Set<K>
keySet()
V
put(K k, V v)
void
putAll(Map<? extends K,? extends V> map)
V
remove(Object o)
int
size()
long
sizeAsLong()
Gets the number of keys in the store as a longCollection<V>
values()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.AutoCloseable
close
-
Methods inherited from interface com.gengoai.kv.KeyValueStore
commit
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
AbstractKeyValueStore
protected AbstractKeyValueStore(String namespace, boolean readOnly)
Instantiates a new Abstract navigable key value store.- Parameters:
namespace
- the namespacereadOnly
- the read only
-
-
Method Detail
-
containsKey
public boolean containsKey(Object o)
- Specified by:
containsKey
in interfaceMap<K,V>
-
containsValue
public boolean containsValue(Object o)
- Specified by:
containsValue
in interfaceMap<K,V>
-
getNameSpace
public String getNameSpace()
Description copied from interface:KeyValueStore
Gets the namespace of the key-value store- Specified by:
getNameSpace
in interfaceKeyValueStore<K,V>
- Returns:
- the name space
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:KeyValueStore
Is this key-value store read-only?- Specified by:
isReadOnly
in interfaceKeyValueStore<K,V>
- Returns:
- True - read only, False - writeable
-
sizeAsLong
public long sizeAsLong()
Description copied from interface:KeyValueStore
Gets the number of keys in the store as a long- Specified by:
sizeAsLong
in interfaceKeyValueStore<K,V>
- Returns:
- the number of keys in the store
-
-