Class ManagedConcurrentWeakHashMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.apache.tomcat.util.collections.ManagedConcurrentWeakHashMap<K,V>
-
- Type Parameters:
K
- The type of keys used with the Map instanceV
- The type of values used with the Map instance
- All Implemented Interfaces:
java.util.concurrent.ConcurrentMap<K,V>
,java.util.Map<K,V>
public class ManagedConcurrentWeakHashMap<K,V> extends java.util.AbstractMap<K,V> implements java.util.concurrent.ConcurrentMap<K,V>
Concurrent hash map that holds its keys via weak references. UnlikeWeakHashMap
this class does not handle dead keys during common access operations, but expects you to call itsmaintain()
method periodically. Both keys and values are expected to be not-null
.
-
-
Constructor Summary
Constructors Constructor Description ManagedConcurrentWeakHashMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<K,V>>
entrySet()
V
get(java.lang.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(java.lang.Object key)
boolean
remove(java.lang.Object key, java.lang.Object value)
V
replace(K key, V value)
boolean
replace(K key, V oldValue, V newValue)
int
size()
java.util.Collection<V>
values()
-
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, keySet, putAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
maintain
public void maintain()
Method, that has to be invoked periodically to clean dead keys from the map.
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
containsValue
public boolean containsValue(java.lang.Object value)
-
containsKey
public boolean containsKey(java.lang.Object key)
-
get
public V get(java.lang.Object key)
-
remove
public V remove(java.lang.Object key)
-
clear
public void clear()
-
remove
public boolean remove(java.lang.Object key, java.lang.Object value)
-
values
public java.util.Collection<V> values()
-
-