T - A phantom type parameterpublic final class PVectorByteBufferedM2D<T> extends ByteBuffered implements PVectorByteBuffered2DType<T>
A two-element vector type with double elements, packed into a
ByteBuffer.
Values of this type cannot be accessed safely from multiple threads without explicit synchronization.
| Modifier and Type | Method and Description |
|---|---|
void |
copyFrom2D(VectorReadable2DType in_v)
Set the current vector to the contents of the input vector.
|
void |
copyFromTyped2D(PVectorReadable2DType<T> in_v)
Set the current vector to the contents of the input vector.
|
boolean |
equals(Object obj) |
double |
getXD() |
double |
getYD() |
int |
hashCode() |
static <T> PVectorByteBuffered2DType<T> |
newVectorFromByteBuffer(ByteBuffer b,
long byte_offset)
Return a new vector that is backed by whatever data is at byte offset
byte_offset in the byte buffer . |
static <T> PVectorByteBuffered2DType<T> |
newVectorFromByteBufferAndBase(ByteBuffer b,
AtomicLong base,
int offset)
Return a new vector that is backed by the given byte buffer
b |
void |
set2D(double x,
double y)
Set the current
x and y values of the current vector. |
void |
setXD(double x)
Set the current
x value of the current vector. |
void |
setYD(double y)
Set the current
y value of the current vector. |
String |
toString() |
getByteOffset, getIndex, getOffset, setBase, setByteOffsetclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetByteOffset, setByteOffsetpublic static <T> PVectorByteBuffered2DType<T> newVectorFromByteBuffer(ByteBuffer b, long byte_offset)
Return a new vector that is backed by whatever data is at byte offset
byte_offset in the byte buffer .
No initialization of the data is performed.
T - A phantom type parameterb - The byte bufferbyte_offset - A byte offsetpublic static <T> PVectorByteBuffered2DType<T> newVectorFromByteBufferAndBase(ByteBuffer b, AtomicLong base, int offset)
Return a new vector that is backed by the given byte buffer b
The data for the instance will be taken from the data at the current
value of base.get() + offset, each time a field is requested or
set.
No initialization of the data is performed.
T - A phantom type parameterb - The byte bufferbase - The base addressoffset - A constant offsetpublic double getXD()
getXD in interface VectorReadable2DTypepublic void setXD(double x)
VectorWritable2DTypex value of the current vector.setXD in interface VectorWritable2DTypex - The new x value.public double getYD()
getYD in interface VectorReadable2DTypepublic void setYD(double y)
VectorWritable2DTypey value of the current vector.setYD in interface VectorWritable2DTypey - The new y value.public void copyFrom2D(VectorReadable2DType in_v)
VectorWritable2DTypecopyFrom2D in interface VectorWritable2DTypein_v - The input vectorpublic void set2D(double x,
double y)
VectorWritable2DTypex and y values of the current vector.set2D in interface VectorWritable2DTypex - The new x value.y - The new y value.public void copyFromTyped2D(PVectorReadable2DType<T> in_v)
PVectorWritable2DTypecopyFromTyped2D in interface PVectorWritable2DType<T>in_v - The input vectorCopyright © 2017 <code@io7m.com> http://io7m.com