public 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
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>
public boolean remove(Object key, Object value)
remove
in interface ConcurrentMap<K,V>
public boolean replace(K key, V oldValue, V newValue)
replace
in interface ConcurrentMap<K,V>
public Collection<V> values()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.