Module org.apache.lucene.memory
Package org.apache.lucene.index.memory
Class MemoryIndex.SlicedIntBlockPool.SliceWriter
- java.lang.Object
-
- org.apache.lucene.index.memory.MemoryIndex.SlicedIntBlockPool.SliceWriter
-
- Enclosing class:
- MemoryIndex.SlicedIntBlockPool
static class MemoryIndex.SlicedIntBlockPool.SliceWriter extends java.lang.Object
AMemoryIndex.SlicedIntBlockPool.SliceWriter
that allows to write multiple integer slices into a givenIntBlockPool
.
-
-
Field Summary
Fields Modifier and Type Field Description private int
offset
private MemoryIndex.SlicedIntBlockPool
slicedIntBlockPool
-
Constructor Summary
Constructors Constructor Description SliceWriter(MemoryIndex.SlicedIntBlockPool slicedIntBlockPool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCurrentOffset()
Returns the offset of the currently written slice.void
reset(int sliceOffset)
int
startNewSlice()
starts a new slice and returns the start offset.void
writeInt(int value)
Writes the given value into the slice and resizes the slice if needed
-
-
-
Field Detail
-
offset
private int offset
-
slicedIntBlockPool
private final MemoryIndex.SlicedIntBlockPool slicedIntBlockPool
-
-
Constructor Detail
-
SliceWriter
public SliceWriter(MemoryIndex.SlicedIntBlockPool slicedIntBlockPool)
-
-
Method Detail
-
reset
public void reset(int sliceOffset)
-
writeInt
public void writeInt(int value)
Writes the given value into the slice and resizes the slice if needed
-
startNewSlice
public int startNewSlice()
starts a new slice and returns the start offset. The returned value should be used as the start offset to initialize aMemoryIndex.SlicedIntBlockPool.SliceReader
.
-
getCurrentOffset
public int getCurrentOffset()
Returns the offset of the currently written slice. The returned value should be used as the end offset to initialize aMemoryIndex.SlicedIntBlockPool.SliceReader
once this slice is fully written or to reset the this writer if another slice needs to be written.
-
-