Package org.apfloat
Class ConcurrentWeakHashMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.apfloat.ConcurrentWeakHashMap<K,V>
-
- All Implemented Interfaces:
java.util.Map<K,V>
class ConcurrentWeakHashMap<K,V> extends java.util.AbstractMap<K,V>
Combination of WeakHashMap and ConcurrentHashMap, providing weak keys and non-blocking access.- Since:
- 1.5
- Version:
- 1.9.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ConcurrentWeakHashMap.Key
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.ConcurrentHashMap<ConcurrentWeakHashMap.Key,V>
map
private java.lang.ref.ReferenceQueue<java.lang.Object>
queue
-
Constructor Summary
Constructors Constructor Description ConcurrentWeakHashMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
java.util.Set<java.util.Map.Entry<K,V>>
entrySet()
private void
expungeStaleEntries()
V
get(java.lang.Object key)
boolean
isEmpty()
V
put(K key, V value)
V
remove(java.lang.Object key)
int
size()
private ConcurrentWeakHashMap.Key
wrap(java.lang.Object key)
-
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, keySet, putAll, toString, values
-
-
-
-
Field Detail
-
map
private java.util.concurrent.ConcurrentHashMap<ConcurrentWeakHashMap.Key,V> map
-
queue
private java.lang.ref.ReferenceQueue<java.lang.Object> queue
-
-
Method Detail
-
clear
public void clear()
-
get
public V get(java.lang.Object key)
-
remove
public V remove(java.lang.Object key)
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
wrap
private ConcurrentWeakHashMap.Key wrap(java.lang.Object key)
-
expungeStaleEntries
private void expungeStaleEntries()
-
-