Package org.apache.lucene.util
Class RefCount<T>
java.lang.Object
org.apache.lucene.util.RefCount<T>
Manages reference counting for a given object. Extensions can override
release()
to do
custom logic when reference counting hits 0.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
object
-
-
Constructor Details
-
RefCount
-
-
Method Details
-
release
Called when reference counting hits 0. By default this method does nothing, but extensions can override to e.g. release resources attached to object that is managed by this class.- Throws:
IOException
-
decRef
Decrements the reference counting of this object. When reference counting hits 0, callsrelease()
.- Throws:
IOException
-
get
-
getRefCount
public final int getRefCount()Returns the current reference count. -
incRef
public final void incRef()Increments the reference count. Calls to this method must be matched with calls todecRef()
.
-