Class PVectorByteBufferedIntegral4s32<T>
java.lang.Object
com.io7m.jtensors.storage.bytebuffered.PVectorByteBufferedIntegral4s32<T>
- Type Parameters:
T- A phantom type parameter
- All Implemented Interfaces:
PVectorReadable2LType<T>,PVectorReadable3LType<T>,PVectorReadable4LType<T>,VectorReadable2LType,VectorReadable3LType,VectorReadable4LType,PVectorStorageIntegral2Type<T>,PVectorStorageIntegral3Type<T>,PVectorStorageIntegral4Type<T>,VectorStorageIntegral2Type,VectorStorageIntegral3Type,VectorStorageIntegral4Type,VectorStorageType,PVectorByteBufferedIntegral4Type<T>,TensorByteBufferedType,VectorByteBufferedType
public final class PVectorByteBufferedIntegral4s32<T> extends java.lang.Object implements PVectorByteBufferedIntegral4Type<T>
A storage vector.
Storage component type: int
Storage component count: 4
-
Method Summary
Modifier and Type Method Description java.nio.ByteBufferbyteBuffer()longbyteOffset()protected intbyteOffsetForIndex(int component_index)protected intcomponentBytes()protected intcomponentCount()static <T> PVectorByteBufferedIntegral4s32<T>createWithBase(java.nio.ByteBuffer b, com.io7m.mutable.numbers.core.MutableLongType base, int offset)Return a new vector that is backed by the given byte bufferbintoffset()voidsetW(long w)Set thewcomponent.voidsetX(long x)Set thexcomponent.voidsetY(long y)Set theYcomponent.voidsetZ(long z)Set thezcomponent.intsizeBytes()longw()longx()longy()longz()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.io7m.jtensors.storage.api.parameterized.vectors.PVectorStorageIntegral2Type
setPVector2I, setPVector2LMethods inherited from interface com.io7m.jtensors.storage.api.parameterized.vectors.PVectorStorageIntegral3Type
setPVector3I, setPVector3LMethods inherited from interface com.io7m.jtensors.storage.api.parameterized.vectors.PVectorStorageIntegral4Type
setPVector4I, setPVector4LMethods inherited from interface com.io7m.jtensors.storage.bytebuffered.TensorByteBufferedType
byteBuffer, byteOffset, offset, sizeBytesMethods inherited from interface com.io7m.jtensors.storage.api.unparameterized.vectors.VectorStorageIntegral2Type
setVector2I, setVector2L, setXYMethods inherited from interface com.io7m.jtensors.storage.api.unparameterized.vectors.VectorStorageIntegral3Type
setVector3I, setVector3L, setXYZMethods inherited from interface com.io7m.jtensors.storage.api.unparameterized.vectors.VectorStorageIntegral4Type
setVector4I, setVector4L, setXYZW
-
Method Details
-
createWithBase
public static <T> PVectorByteBufferedIntegral4s32<T> createWithBase(java.nio.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.
- Type Parameters:
T- A phantom type parameter- 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
-
z
public long z()- Specified by:
zin interfaceVectorReadable3LType- Returns:
- The
zcomponent
-
w
public long w()- Specified by:
win interfaceVectorReadable4LType- Returns:
- The
wcomponent
-
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
-
setZ
public void setZ(long z)Description copied from interface:VectorStorageIntegral3TypeSet thezcomponent.- Specified by:
setZin interfaceVectorStorageIntegral3Type- Parameters:
z- The Z component
-
setW
public void setW(long w)Description copied from interface:VectorStorageIntegral4TypeSet thewcomponent.- Specified by:
setWin interfaceVectorStorageIntegral4Type- Parameters:
w- The W component
-
componentBytes
protected final int componentBytes() -
byteBuffer
public final java.nio.ByteBuffer 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)
-