public final class VectorByteBufferedM2F extends ByteBuffered implements VectorByteBuffered2FType
A two-element vector type with float 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 |
copyFrom2F(VectorReadable2FType in_v)
Set the current vector to the contents of the input vector.
|
boolean |
equals(Object obj) |
float |
getXF() |
float |
getYF() |
int |
hashCode() |
static VectorByteBuffered2FType |
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 VectorByteBuffered2FType |
newVectorFromByteBufferAndBase(ByteBuffer b,
AtomicLong base,
int offset)
Return a new vector that is backed by the given byte buffer
b |
void |
set2F(float x,
float y)
Set the current
x and y values of the current vector. |
void |
setXF(float x)
Set the current
x value of the current vector. |
void |
setYF(float 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 VectorByteBuffered2FType 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.
b - The byte bufferbyte_offset - A byte offsetpublic static VectorByteBuffered2FType 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.
b - The byte bufferbase - The base addressoffset - A constant offsetpublic float getXF()
getXF in interface VectorReadable2FTypepublic void setXF(float x)
VectorWritable2FTypex value of the current vector.setXF in interface VectorWritable2FTypex - The new x value.public float getYF()
getYF in interface VectorReadable2FTypepublic void setYF(float y)
VectorWritable2FTypey value of the current vector.setYF in interface VectorWritable2FTypey - The new y value.public void copyFrom2F(VectorReadable2FType in_v)
VectorWritable2FTypecopyFrom2F in interface VectorWritable2FTypein_v - The input vectorpublic void set2F(float x,
float y)
VectorWritable2FTypex and y values of the current vector.set2F in interface VectorWritable2FTypex - The new x value.y - The new y value.Copyright © 2016 <code@io7m.com> http://io7m.com