public class AbstractKeyValueStore<K,V> extends net.openhft.chronicle.core.io.SimpleCloseable implements KeyValueStore<K,V>
KeyValueStore.Entry<K,V>
Modifier and Type | Field and Description |
---|---|
@NotNull KeyValueStore<K,V> |
kvStore |
Modifier and Type | Method and Description |
---|---|
Asset |
asset() |
void |
clear() |
boolean |
containsKey(K key) |
boolean |
containsValue(V value) |
void |
entriesFor(int segment,
SubscriptionConsumer<MapEvent<K,V>> kvConsumer) |
Iterator<Map.Entry<K,V>> |
entrySetIterator() |
V |
get(K key) |
V |
getAndPut(K key,
V value) |
V |
getAndRemove(K key) |
V |
getUsing(K key,
Object value) |
boolean |
isKeyType(Object key) |
boolean |
isReadOnly() |
boolean |
keyedView()
Returns if this is a keyed asset, i.e.
|
Iterator<K> |
keySetIterator() |
void |
keysFor(int segment,
SubscriptionConsumer<K> kConsumer) |
Class<K> |
keyType() |
long |
longSize() |
protected void |
performClose() |
boolean |
put(K key,
V value)
put an entry
|
V |
putIfAbsent(K key,
V value) |
boolean |
remove(K key)
remove a key
|
boolean |
removeIfEqual(K key,
V value) |
V |
replace(K key,
V value) |
boolean |
replaceIfEqual(K key,
V oldValue,
V newValue) |
int |
segmentFor(K key) |
int |
segments() |
@NotNull KeyValueStore<K,V> |
underlying() |
Class<V> |
valueType() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
valuesIterator
close, closeQuietly, closeQuietly, notifyClosing, warnAndCloseIfNotClosed
isClosed, isClosing, throwExceptionIfClosed
@NotNull public final @NotNull KeyValueStore<K,V> kvStore
@NotNull public @NotNull KeyValueStore<K,V> underlying()
underlying
in interface Assetted<KeyValueStore<K,V>>
@Nullable public V getAndPut(K key, V value)
getAndPut
in interface KeyValueStore<K,V>
@Nullable public V getAndRemove(K key)
getAndRemove
in interface KeyValueStore<K,V>
@Nullable public V getUsing(K key, Object value)
getUsing
in interface KeyValueStore<K,V>
public Iterator<Map.Entry<K,V>> entrySetIterator()
entrySetIterator
in interface KeyValueStore<K,V>
public long longSize()
longSize
in interface KeyValueStore<K,V>
public void keysFor(int segment, SubscriptionConsumer<K> kConsumer) throws InvalidSubscriberException
keysFor
in interface KeyValueStore<K,V>
InvalidSubscriberException
public void entriesFor(int segment, SubscriptionConsumer<MapEvent<K,V>> kvConsumer) throws InvalidSubscriberException
entriesFor
in interface KeyValueStore<K,V>
InvalidSubscriberException
public Asset asset()
asset
in interface Assetted<KeyValueStore<K,V>>
public void clear()
clear
in interface KeyValueStore<K,V>
@Nullable public V replace(K key, V value)
replace
in interface KeyValueStore<K,V>
protected void performClose()
performClose
in class net.openhft.chronicle.core.io.SimpleCloseable
public boolean put(K key, V value)
KeyValueStore
put
in interface KeyValueStore<K,V>
key
- to setvalue
- to setpublic boolean remove(K key)
KeyValueStore
remove
in interface KeyValueStore<K,V>
key
- to removepublic boolean containsKey(K key)
containsKey
in interface KeyValueStore<K,V>
public boolean isReadOnly()
isReadOnly
in interface KeyValueStore<K,V>
public int segments()
segments
in interface KeyValueStore<K,V>
public int segmentFor(K key)
segmentFor
in interface KeyValueStore<K,V>
public boolean replaceIfEqual(K key, V oldValue, V newValue)
replaceIfEqual
in interface KeyValueStore<K,V>
public boolean removeIfEqual(K key, V value)
removeIfEqual
in interface KeyValueStore<K,V>
public boolean isKeyType(Object key)
isKeyType
in interface KeyValueStore<K,V>
@Nullable public V putIfAbsent(K key, V value)
putIfAbsent
in interface KeyValueStore<K,V>
public boolean keyedView()
KeyedView
public boolean containsValue(V value)
containsValue
in interface KeyValueStore<K,V>
public Iterator<K> keySetIterator()
keySetIterator
in interface KeyValueStore<K,V>
Copyright © 2021. All rights reserved.