Class RefCount<T>

java.lang.Object
org.apache.lucene.util.RefCount<T>

public class RefCount<T> extends Object
Manages reference counting for a given object. Extensions can override release() to do custom logic when reference counting hits 0.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RefCount(T object)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Decrements the reference counting of this object.
    final T
    get()
     
    final int
    Returns the current reference count.
    final void
    Increments the reference count.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RefCount

      public RefCount(T object)
  • Method Details

    • decRef

      public final void decRef() throws IOException
      Decrements the reference counting of this object. When reference counting hits 0, calls release().
      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 to decRef().