Package org.eclipse.net4j.util.ref
Class ReferenceValueMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.eclipse.net4j.util.ref.ReferenceValueMap2<K,V>
-
- org.eclipse.net4j.util.ref.ReferenceValueMap<K,V>
-
- All Implemented Interfaces:
java.util.concurrent.ConcurrentMap<K,V>,java.util.Map<K,V>
- Direct Known Subclasses:
ReferenceValueMap.Soft,ReferenceValueMap.Strong,ReferenceValueMap.Weak
public abstract class ReferenceValueMap<K,V> extends ReferenceValueMap2<K,V> implements java.util.concurrent.ConcurrentMap<K,V>
AConcurrentMapimplementation that usesKeyedReferenceinstances (KeyedStrongReference,KeyedSoftReference,KeyedWeakReferenceorKeyedPhantomReference) as its values.A
ReferenceValueMapcan be used to cache mappings until the value of the mapping is no longer reachable from outside of the mapNote: This map is not synchronized. If it is to be used by multiple threads concurrently the user is responsible for applying proper external synchronization!
- Author:
- Eike Stepper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReferenceValueMap.Soft<K,V>static classReferenceValueMap.Strong<K,V>static classReferenceValueMap.Weak<K,V>
-
Constructor Summary
Constructors Constructor Description ReferenceValueMap()ReferenceValueMap(java.util.concurrent.ConcurrentMap<K,KeyedReference<K,V>> map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VputIfAbsent(K key, V value)booleanremove(java.lang.Object key, java.lang.Object value)Vreplace(K key, V value)booleanreplace(K key, V oldValue, V newValue)-
Methods inherited from class org.eclipse.net4j.util.ref.ReferenceValueMap2
clear, containsKey, containsValue, createQueue, createReference, dereference, entrySet, get, internalPurgeQueue, isEmpty, purged, purgeQueue, put, remove, size
-
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, keySet, putAll, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
ReferenceValueMap
public ReferenceValueMap()
-
ReferenceValueMap
public ReferenceValueMap(java.util.concurrent.ConcurrentMap<K,KeyedReference<K,V>> map)
-
-