Package org.apache.lucene.util
Class RollingBuffer<T extends RollingBuffer.Resettable>
java.lang.Object
org.apache.lucene.util.RollingBuffer<T>
Acts like forever growing T[], but internally uses a
circular buffer to reuse instances of T.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Implement to reset an instance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
freeBefore
(int pos) get
(int pos) Get T instance for this absolute position; this is allowed to be arbitrarily far "in the future" but cannot be before the last freeBefore.int
Returns the maximum position looked up, or -1 if no position has been looked up sinc reset/init.void
reset()
-
Constructor Details
-
RollingBuffer
public RollingBuffer()
-
-
Method Details
-
reset
public void reset() -
get
Get T instance for this absolute position; this is allowed to be arbitrarily far "in the future" but cannot be before the last freeBefore. -
getMaxPos
public int getMaxPos()Returns the maximum position looked up, or -1 if no position has been looked up sinc reset/init. -
freeBefore
public void freeBefore(int pos)
-