Class EquatableWeakReference<T>

java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference<T>
etithespirit.orimod.util.collection.EquatableWeakReference<T>
Type Parameters:
T -

public class EquatableWeakReference<T> extends WeakReference<T>
A modified variation of a weak reference that somewhat violates its contract by allowing two things:
  • Allowing this reference to be compared to another with equals(java.lang.Object)
  • Allowing this reference to form a strong reference to its stored object (for its use in WeakList)
  • Constructor Details

    • EquatableWeakReference

      public EquatableWeakReference(T referent)
      Creates a new weak reference that refers to the given object. The new reference is not registered with any queue.
      Parameters:
      referent - object the new weak reference will refer to
    • EquatableWeakReference

      public EquatableWeakReference(T referent, ReferenceQueue<? super T> q)
      Creates a new weak reference that refers to the given object and is registered with the given queue.
      Parameters:
      referent - object the new weak reference will refer to
      q - the queue with which the reference is to be registered, or null if registration is not required
  • Method Details