Package tenapull.sync
Class WeakInstancesTracker.WeakRef
java.lang.Object
tenapull.sync.WeakInstancesTracker.WeakRef
- All Implemented Interfaces:
InstancesTracker.KeyFinalizer<WeakInstancesTracker.WeakRef,I>
- Enclosing class:
- WeakInstancesTracker<K,I>
public class WeakInstancesTracker.WeakRef extends java.lang.Object implements InstancesTracker.KeyFinalizer<WeakInstancesTracker.WeakRef,I>
A wrapper for WeakReference that also implement the Instances.KeyFinalizer interface,
so that a key is held as a strong reference until it has been finalized
-
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object o)voidfinalizeKey(I instance)Method invoked immediately after finalization is completed.Kget()Get the key which this references, or null if it has been GC'd
-
Method Details
-
get
Get the key which this references, or null if it has been GC'd- Returns:
- the key
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
finalizeKey
Description copied from interface:InstancesTracker.KeyFinalizerMethod invoked immediately after finalization is completed.- Specified by:
finalizeKeyin interfaceInstancesTracker.KeyFinalizer<WeakInstancesTracker.WeakRef,I>- Parameters:
instance- the instance that was finalized, meaning moved from underConstruction to instances
-