Class ProceduralReferenceCounted
java.lang.Object
com.illumon.util.referencecounting.ReferenceCounted
com.illumon.util.referencecounting.ProceduralReferenceCounted
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable
,Serializable
public final class ProceduralReferenceCounted extends ReferenceCounted
A
ReferenceCounted
implementation that takes a Runnable
onReferenceCountAtZero procedure, in order
to avoid relying on inheritance where necessary or desirable.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description ProceduralReferenceCounted(Runnable onReferenceCountAtZeroProcedure)
ProceduralReferenceCounted(Runnable onReferenceCountAtZeroProcedure, int initialValue)
-
Method Summary
Modifier and Type Method Description protected void
onReferenceCountAtZero()
Callback method that will be invoked when the reference count returns to zero.Methods inherited from class com.illumon.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCount
-
Constructor Details
-
ProceduralReferenceCounted
public ProceduralReferenceCounted(@NotNull Runnable onReferenceCountAtZeroProcedure, int initialValue) -
ProceduralReferenceCounted
-
-
Method Details
-
onReferenceCountAtZero
protected final void onReferenceCountAtZero()Description copied from class:ReferenceCounted
Callback method that will be invoked when the reference count returns to zero.- Specified by:
onReferenceCountAtZero
in classReferenceCounted
-