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 Details

    • SoftValueReference

      public SoftValueReference(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.
      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 is null.
  • Method Details