Class DowngradableReference<T>

java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference<T>
io.deephaven.base.reference.DowngradableReference<T>
Type Parameters:
T -
All Implemented Interfaces:
SimpleReference<T>

public class DowngradableReference<T> extends WeakReference<T> implements SimpleReference<T>
SimpleReference implementation that allows a downgrade from strongly reachable to weakly reachable.
Note:
This only applies (obviously) to this reference's relationship to the referent.
  • Constructor Details

    • DowngradableReference

      public DowngradableReference(T referent)
  • Method Details

    • clear

      public void clear()
      Description copied from interface: SimpleReference
      Clear the referent.
      Specified by:
      clear in interface SimpleReference<T>
      Overrides:
      clear in class Reference<T>
    • downgrade

      public void downgrade()
      Eliminate this object's hard reference to the referent. Converts the reachability enforced by this object from hard to weak.