public class VecBufferBlocks extends CompoundVecBuffer
addBlock(int, int)
, where the positions define the byte range containing a VecBuffer's data.CompoundVecBuffer.CompoundIterator<T>, CompoundVecBuffer.CoordIterable, CompoundVecBuffer.EmptyCompoundVecBuffer, CompoundVecBuffer.LocationIterable, CompoundVecBuffer.PositionIterable, CompoundVecBuffer.ReverseCompoundIterator<T>, CompoundVecBuffer.SubBufferIterable<T>, CompoundVecBuffer.VectorIterable
Modifier and Type | Field and Description |
---|---|
protected ByteBuffer |
buffer |
protected int |
coordsPerVec |
protected String |
dataType |
ALLOCATE_DIRECT_BUFFERS, capacity, count, DEFAULT_INITIAL_CAPACITY, lengths, offsets
Modifier | Constructor and Description |
---|---|
|
VecBufferBlocks(int coordsPerVec,
String dataType,
ByteBuffer buffer)
Constructs a VecBufferBlocks with the specified number of coordinates per logical vector, primitive data type,
and backing ByteBuffer.
|
|
VecBufferBlocks(int coordsPerVec,
String dataType,
ByteBuffer buffer,
int capacity)
Constructs a VecBufferBlocks with the specified number of coordinates per logical vector, primitive data type,
backing ByteBuffer and the specified initial capacity.
|
protected |
VecBufferBlocks(VecBufferBlocks that,
int[] indices,
int offset,
int length) |
protected |
VecBufferBlocks(VecBufferBlocks that,
int beginIndex,
int endIndex) |
Modifier and Type | Method and Description |
---|---|
int |
addBlock(int beginPos,
int endPos)
Adds a range of bytes that define a new sub-buffer within this VecBufferBlocks.
|
protected CompoundVecBuffer |
createSlice(int[] indices,
int offset,
int length) |
protected CompoundVecBuffer |
createSlice(int beginIndex,
int endIndex) |
protected VecBuffer |
createSubBuffer(int offsetInBytes,
int lengthInBytes) |
ByteBuffer |
getBuffer()
Returns the ByteBuffer that stores this VecBufferBlocks' sub-buffers.
|
int |
getCoordsPerVec()
Returns the number of coordinates per logical vector element.
|
String |
getDataType()
Returns the primitive data type used to interpret the elements of this VecBufferBlocks' backing ByteBuffer.
|
int |
subBufferSize(int index)
Returns the size in logical vectors of the VecBuffer with the specified index.
|
addSubBuffer, clear, emptyCompoundVecBuffer, expandCapacity, getCoords, getCoords, getLocations, getPositions, getReverseCoords, getReverseLocations, getReversePositions, getReverseVectors, getVectors, size, slice, slice, slice, subBuffer
protected ByteBuffer buffer
protected int coordsPerVec
protected String dataType
public VecBufferBlocks(int coordsPerVec, String dataType, ByteBuffer buffer)
coordsPerVec
- the number of coordinates per logical vector.dataType
- the primitive data type.buffer
- the backing ByteBuffer.IllegalArgumentException
- if the coordsPerVec is less than 1, if the dataType is null, or if the buffer is
null.public VecBufferBlocks(int coordsPerVec, String dataType, ByteBuffer buffer, int capacity)
coordsPerVec
- the number of coordinates per logical vector.dataType
- the primitive data type.buffer
- the backing ByteBuffer.capacity
- the PackedCompoundVecBuffer's initial capacity, in number of sub-buffers.IllegalArgumentException
- if the coordsPerVec is less than 1, if the dataType is null, if the buffer is
null, or if the capacity is less than 1.protected VecBufferBlocks(VecBufferBlocks that, int[] indices, int offset, int length)
protected VecBufferBlocks(VecBufferBlocks that, int beginIndex, int endIndex)
public int addBlock(int beginPos, int endPos)
beginPos
- the byte range's beginning position.endPos
- the byte range's ending position (inclusive).IllegalArgumentException
- if either the position are less than zero, if either position is greater than
the backing buffer's capacity, or if the begin position is greater than the end
position.protected CompoundVecBuffer createSlice(int[] indices, int offset, int length)
createSlice
in class CompoundVecBuffer
protected CompoundVecBuffer createSlice(int beginIndex, int endIndex)
createSlice
in class CompoundVecBuffer
protected VecBuffer createSubBuffer(int offsetInBytes, int lengthInBytes)
createSubBuffer
in class CompoundVecBuffer
public ByteBuffer getBuffer()
public int getCoordsPerVec()
getCoordsPerVec
in class CompoundVecBuffer
public String getDataType()
public int subBufferSize(int index)
subBufferSize
in class CompoundVecBuffer
index
- the index for the VecBuffer who's size is returned.