Class PurgeOnWriteWeakValueHashMap.WeakValueReference<K,V>

java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference<V>
com.globalmentor.collections.PurgeOnWriteWeakValueHashMap.WeakValueReference<K,V>
Type Parameters:
K - The type of key.
V - The type of value.
All Implemented Interfaces:
AbstractPurgeOnWriteReferenceValueMap.Keyed<K>
Enclosing class:
PurgeOnWriteWeakValueHashMap<K,V>

public static class PurgeOnWriteWeakValueHashMap.WeakValueReference<K,V> extends WeakReference<V> implements AbstractPurgeOnWriteReferenceValueMap.Keyed<K>
A weak reference that keeps track of the key with which a value was associated.
Author:
Garret Wilson
  • Constructor Details

    • WeakValueReference

      public WeakValueReference(K key, V value, ReferenceQueue<? super V> referenceQueue)
      Creates a new weak 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 weak reference will refer.
      referenceQueue - The queue with which the reference is to be registered.
      Throws:
      NullPointerException - if the given reference queue is null.
  • Method Details