Package com.globalmentor.collections
Class PurgeOnWriteSoftValueHashMap.SoftValueReference<K,V>
- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- java.lang.ref.SoftReference<V>
-
- com.globalmentor.collections.PurgeOnWriteSoftValueHashMap.SoftValueReference<K,V>
-
- Type Parameters:
K
- The type of key.V
- The type of value.
- All Implemented Interfaces:
AbstractPurgeOnWriteReferenceValueMap.Keyed<K>
- Enclosing class:
- PurgeOnWriteSoftValueHashMap<K,V>
public static class PurgeOnWriteSoftValueHashMap.SoftValueReference<K,V> extends java.lang.ref.SoftReference<V> implements AbstractPurgeOnWriteReferenceValueMap.Keyed<K>
A soft reference that keeps track of the key with which a value was associated.- Author:
- Garret Wilson
-
-
Constructor Summary
Constructors Constructor Description SoftValueReference(K key, V value, java.lang.ref.ReferenceQueue<? super V> referenceQueue)
Creates a new soft reference that remembers the given key, refers to the given object, and is registered with the given queue.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description K
getKey()
-
-
-
Constructor Detail
-
SoftValueReference
public SoftValueReference(K key, V value, java.lang.ref.ReferenceQueue<? super V> referenceQueue)
Creates a new soft reference that remembers the given key, refers to the given object, and is registered with the given queue.- Parameters:
key
- The key with which the value is being associated.value
- The value to which the new soft reference will refer.referenceQueue
- The queue with which the reference is to be registered.- Throws:
java.lang.NullPointerException
- if the given reference queue isnull
.
-
-
Method Detail
-
getKey
public K getKey()
- Specified by:
getKey
in interfaceAbstractPurgeOnWriteReferenceValueMap.Keyed<K>
- Returns:
- They key with which the referent value was associated.
-
-