Expert: increments the refCount of this IndexReader instance only if the IndexReader has not been closed yet and returns
true
iff the refCount was successfully incremented, otherwise
false
. If this method returns
false
the reader is either already closed or is currently been closed. Either way this reader instance shouldn't be used by an application unless
true
is returned.
RefCounts are used to determine when a reader can be closed safely, i.e. as soon as there are no more references. Be sure to always call a corresponding {@link #decRef}, in a finally clause; otherwise the reader may never be closed. Note that {@link #close} simply calls decRef(), which means thatthe IndexReader will not really be closed until {@link #decRef} has been called for all outstandingreferences.
@see #decRef
@see #incRef