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 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
ConstructorDescriptionSoftValueReference
(K key, V value, 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
Methods inherited from class java.lang.ref.SoftReference
get
Methods inherited from class java.lang.ref.Reference
clear, enqueue, isEnqueued
-
Constructor Details
-
SoftValueReference
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:
NullPointerException
- if the given reference queue isnull
.
-
-
Method Details
-
getKey
- Specified by:
getKey
in interfaceAbstractPurgeOnWriteReferenceValueMap.Keyed<K>
- Returns:
- They key with which the referent value was associated.
-