|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.util.IntBlockPool
public final class IntBlockPool
A pool for int blocks similar to ByteBlockPool
Nested Class Summary | |
---|---|
static class |
IntBlockPool.Allocator
Abstract class for allocating and freeing int blocks. |
static class |
IntBlockPool.DirectAllocator
A simple IntBlockPool.Allocator that never recycles. |
static class |
IntBlockPool.SliceReader
A IntBlockPool.SliceReader that can read int slices written by a IntBlockPool.SliceWriter |
static class |
IntBlockPool.SliceWriter
A IntBlockPool.SliceWriter that allows to write multiple integer slices into a given IntBlockPool . |
Field Summary | |
---|---|
int[] |
buffer
Current head buffer |
int[][] |
buffers
array of buffers currently used in the pool. |
static int |
INT_BLOCK_MASK
|
static int |
INT_BLOCK_SHIFT
|
static int |
INT_BLOCK_SIZE
|
int |
intOffset
Current head offset |
int |
intUpto
Pointer to the current position in head buffer |
Constructor Summary | |
---|---|
IntBlockPool()
Creates a new IntBlockPool with a default IntBlockPool.Allocator . |
|
IntBlockPool(IntBlockPool.Allocator allocator)
Creates a new IntBlockPool with the given IntBlockPool.Allocator . |
Method Summary | |
---|---|
void |
nextBuffer()
Advances the pool to its next buffer. |
void |
reset()
Resets the pool to its initial state reusing the first buffer. |
void |
reset(boolean zeroFillBuffers,
boolean reuseFirst)
Expert: Resets the pool to its initial state reusing the first buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int INT_BLOCK_SHIFT
public static final int INT_BLOCK_SIZE
public static final int INT_BLOCK_MASK
public int[][] buffers
public int intUpto
public int[] buffer
public int intOffset
Constructor Detail |
---|
public IntBlockPool()
IntBlockPool
with a default IntBlockPool.Allocator
.
nextBuffer()
public IntBlockPool(IntBlockPool.Allocator allocator)
IntBlockPool
with the given IntBlockPool.Allocator
.
nextBuffer()
Method Detail |
---|
public void reset()
nextBuffer()
is not needed after reset.
public void reset(boolean zeroFillBuffers, boolean reuseFirst)
zeroFillBuffers
- if true
the buffers are filled with 0.
This should be set to true
if this pool is used with
IntBlockPool.SliceWriter
.reuseFirst
- if true
the first buffer will be reused and calling
nextBuffer()
is not needed after reset iff the
block pool was used before ie. nextBuffer()
was called before.public void nextBuffer()
reset()
call will advance the pool to
its first buffer immediately.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |