|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.util.CompoundVecBuffer
gov.nasa.worldwind.util.VecBufferBlocks
public class VecBufferBlocks
VecBufferBlocks provides storage and retrieval of a set of potentially random VecBuffer blocks in a single backing
ByteBuffer. Its is assumeed that the backing ByteBuffer already contains the necessary data, and the caller defines
which regions in the ByteBuffer define each individual VecBuffer. VecBuffers are defined by calling addBlock(int, int), where the positions define the byte range containing a VecBuffer's data.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class gov.nasa.worldwind.util.CompoundVecBuffer |
|---|
CompoundVecBuffer.CompoundIterator<T>, CompoundVecBuffer.CoordIterable, CompoundVecBuffer.EmptyCompoundVecBuffer, CompoundVecBuffer.LocationIterable, CompoundVecBuffer.PositionIterable, CompoundVecBuffer.ReverseCompoundIterator<T>, CompoundVecBuffer.SubBufferIterable<T>, CompoundVecBuffer.VectorIterable |
| Field Summary | |
|---|---|
protected ByteBuffer |
buffer
|
protected int |
coordsPerVec
|
protected String |
dataType
|
| Fields inherited from class gov.nasa.worldwind.util.CompoundVecBuffer |
|---|
ALLOCATE_DIRECT_BUFFERS, capacity, count, DEFAULT_INITIAL_CAPACITY, lengths, offsets |
| Constructor Summary | |
|---|---|
|
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)
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class gov.nasa.worldwind.util.CompoundVecBuffer |
|---|
addSubBuffer, clear, emptyCompoundVecBuffer, expandCapacity, getCoords, getCoords, getLocations, getPositions, getReverseCoords, getReverseLocations, getReversePositions, getReverseVectors, getVectors, size, slice, slice, slice, subBuffer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ByteBuffer buffer
protected int coordsPerVec
protected String dataType
| Constructor Detail |
|---|
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)
| Method Detail |
|---|
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 CompoundVecBufferpublic ByteBuffer getBuffer()
public int getCoordsPerVec()
getCoordsPerVec in class CompoundVecBufferpublic String getDataType()
public int subBufferSize(int index)
subBufferSize in class CompoundVecBufferindex - the index for the VecBuffer who's size is returned.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||