Class VectorByteBufferedIntegral2s64
java.lang.Object
com.io7m.jtensors.storage.bytebuffered.VectorByteBufferedIntegral2s64
- All Implemented Interfaces:
VectorReadable2LType, VectorStorageIntegral2Type, VectorStorageType, TensorByteBufferedType, VectorByteBufferedIntegral2Type, VectorByteBufferedType
public final class VectorByteBufferedIntegral2s64
extends Object
implements VectorByteBufferedIntegral2Type
A storage vector.
Storage component type: long
Storage component count: 2
-
Method Summary
Modifier and TypeMethodDescriptionfinal ByteBufferfinal longprotected final intbyteOffsetForIndex(int component_index) protected final intprotected intcreateWithBase(ByteBuffer b, com.io7m.mutable.numbers.core.MutableLongType base, int offset) Return a new vector that is backed by the given byte bufferbfinal intoffset()voidsetX(long x) Set thexcomponent.voidsetY(long y) Set theYcomponent.final intlongx()longy()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TensorByteBufferedType
byteBuffer, byteOffset, offset, sizeBytesMethods inherited from interface VectorStorageIntegral2Type
setVector2I, setVector2L, setXY
-
Method Details
-
createWithBase
public static VectorByteBufferedIntegral2s64 createWithBase(ByteBuffer b, com.io7m.mutable.numbers.core.MutableLongType base, int offset) Return a new vector that is backed by the given byte buffer
bThe 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.
- Parameters:
b- The byte bufferbase- The base addressoffset- A constant offset- Returns:
- A new buffered vector
-
componentCount
protected int componentCount() -
x
public long x()- Specified by:
xin interfaceVectorReadable2LType- Returns:
- The
xcomponent
-
y
public long y()- Specified by:
yin interfaceVectorReadable2LType- Returns:
- The
ycomponent
-
setX
public void setX(long x) Description copied from interface:VectorStorageIntegral2TypeSet thexcomponent.- Specified by:
setXin interfaceVectorStorageIntegral2Type- Parameters:
x- The X component
-
setY
public void setY(long y) Description copied from interface:VectorStorageIntegral2TypeSet theYcomponent.- Specified by:
setYin interfaceVectorStorageIntegral2Type- Parameters:
y- The Y component
-
componentBytes
protected final int componentBytes() -
byteBuffer
- Specified by:
byteBufferin interfaceTensorByteBufferedType- Returns:
- The byte buffer that backs the tensor
-
byteOffset
public final long byteOffset()- Specified by:
byteOffsetin interfaceTensorByteBufferedType- Returns:
- The byte offset of the current tensor
-
offset
public final int offset()- Specified by:
offsetin interfaceTensorByteBufferedType- Returns:
- A constant offset added to
TensorByteBufferedType.byteOffset().
-
sizeBytes
public final int sizeBytes()- Specified by:
sizeBytesin interfaceTensorByteBufferedType- Returns:
- The size of a single tensor in bytes
-
byteOffsetForIndex
protected final int byteOffsetForIndex(int component_index)
-