K
- the type of keys maintained by this mapV
- the type of mapped values@Beta public abstract class TrieMap<K,V> extends AbstractMap<K,V> implements ConcurrentMap<K,V>, Serializable
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Method and Description |
---|---|
abstract void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
static <K,V> MutableTrieMap<K,V> |
create() |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
abstract ImmutableTrieMap<K,V> |
immutableSnapshot()
Returns a read-only snapshot of this TrieMap.
|
Set<K> |
keySet() |
abstract TrieMap<K,V> |
mutableSnapshot()
Returns a snapshot of this TrieMap.
|
abstract V |
put(K key,
V value) |
abstract V |
putIfAbsent(K key,
V value) |
abstract V |
remove(Object key) |
abstract boolean |
remove(Object key,
Object value) |
abstract V |
replace(K key,
V value) |
abstract boolean |
replace(K key,
V oldValue,
V newValue) |
abstract int |
size() |
clone, equals, hashCode, isEmpty, putAll, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
public static <K,V> MutableTrieMap<K,V> create()
public abstract TrieMap<K,V> mutableSnapshot()
The snapshot is lazily updated - the first time some branch in the snapshot or this TrieMap are accessed, they are rewritten. This means that the work of rebuilding both the snapshot and this TrieMap is distributed across all the threads doing updates or accesses subsequent to the snapshot creation.
public abstract ImmutableTrieMap<K,V> immutableSnapshot()
The snapshot is lazily updated - the first time some branch of this
TrieMap are accessed, it is rewritten. The work of creating the snapshot
is thus distributed across subsequent updates and accesses on this
TrieMap by all threads. Note that the snapshot itself is never rewritten
unlike when calling mutableSnapshot()
, but the obtained snapshot
cannot be modified.
This method is used by other methods such as `size` and `iterator`.
public final boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
public final boolean containsValue(Object value)
containsValue
in interface Map<K,V>
containsValue
in class AbstractMap<K,V>
public abstract void clear()
public abstract V putIfAbsent(K key, V value)
putIfAbsent
in interface ConcurrentMap<K,V>
putIfAbsent
in interface Map<K,V>
Copyright © 2018 OpenDaylight. All rights reserved.