K
- The type of keys used with the Map instanceV
- The type of values used with the Map instancepublic class ManagedConcurrentWeakHashMap<K,V> extends AbstractMap<K,V> implements ConcurrentMap<K,V>
WeakHashMap
this class does not handle dead keys during common
access operations, but expects you to call its maintain()
method
periodically. Both keys and values are expected to be not-null
.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
ManagedConcurrentWeakHashMap() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
boolean |
isEmpty() |
void |
maintain()
Method, that has to be invoked periodically to clean dead keys from the
map.
|
V |
put(K key,
V value) |
V |
putIfAbsent(K key,
V value) |
V |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
V |
replace(K key,
V value) |
boolean |
replace(K key,
V oldValue,
V newValue) |
int |
size() |
Collection<V> |
values() |
clone, equals, hashCode, keySet, putAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
public void maintain()
public int size()
public boolean isEmpty()
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
containsValue
in class AbstractMap<K,V>
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
public void clear()
public V putIfAbsent(K key, V value)
putIfAbsent
in interface ConcurrentMap<K,V>
putIfAbsent
in interface Map<K,V>
public Collection<V> values()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.