Package org.apache.lucene.util
Class RefCount<T>
- java.lang.Object
-
- org.apache.lucene.util.RefCount<T>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecRef()Decrements the reference counting of this object.Tget()intgetRefCount()Returns the current reference count.voidincRef()Increments the reference count.protected voidrelease()Called when reference counting hits 0.
-
-
-
Field Detail
-
object
protected final T object
-
-
Constructor Detail
-
RefCount
public RefCount(T object)
-
-
Method Detail
-
release
protected void release() throws IOExceptionCalled 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
public final void decRef() throws IOExceptionDecrements the reference counting of this object. When reference counting hits 0, callsrelease().- Throws:
IOException
-
get
public final T 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().
-
-