Class VectorByteBufferedIntegral4s32
java.lang.Object
com.io7m.jtensors.storage.bytebuffered.VectorByteBufferedIntegral4s32
- All Implemented Interfaces:
VectorReadable2LType
,VectorReadable3LType
,VectorReadable4LType
,VectorStorageIntegral2Type
,VectorStorageIntegral3Type
,VectorStorageIntegral4Type
,VectorStorageType
,TensorByteBufferedType
,VectorByteBufferedIntegral4Type
,VectorByteBufferedType
public final class VectorByteBufferedIntegral4s32
extends Object
implements VectorByteBufferedIntegral4Type
A storage vector.
Storage component type: int
Storage component count: 4
-
Method Summary
Modifier and TypeMethodDescriptionfinal ByteBuffer
final long
protected final int
byteOffsetForIndex
(int component_index) protected final int
protected int
createWithBase
(ByteBuffer b, com.io7m.mutable.numbers.core.MutableLongType base, int offset) Return a new vector that is backed by the given byte bufferb
final int
offset()
void
setW
(long w) Set thew
component.void
setX
(long x) Set thex
component.void
setY
(long y) Set theY
component.void
setZ
(long z) Set thez
component.final int
long
w()
long
x()
long
y()
long
z()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.io7m.jtensors.storage.bytebuffered.TensorByteBufferedType
byteBuffer, byteOffset, offset, sizeBytes
Methods inherited from interface com.io7m.jtensors.storage.api.unparameterized.vectors.VectorStorageIntegral2Type
setVector2I, setVector2L, setXY
Methods inherited from interface com.io7m.jtensors.storage.api.unparameterized.vectors.VectorStorageIntegral3Type
setVector3I, setVector3L, setXYZ
Methods inherited from interface com.io7m.jtensors.storage.api.unparameterized.vectors.VectorStorageIntegral4Type
setVector4I, setVector4L, setXYZW
-
Method Details
-
createWithBase
public static VectorByteBufferedIntegral4s32 createWithBase(ByteBuffer b, com.io7m.mutable.numbers.core.MutableLongType 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.
- 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:
x
in interfaceVectorReadable2LType
- Returns:
- The
x
component
-
y
public long y()- Specified by:
y
in interfaceVectorReadable2LType
- Returns:
- The
y
component
-
z
public long z()- Specified by:
z
in interfaceVectorReadable3LType
- Returns:
- The
z
component
-
w
public long w()- Specified by:
w
in interfaceVectorReadable4LType
- Returns:
- The
w
component
-
setX
public void setX(long x) Description copied from interface:VectorStorageIntegral2Type
Set thex
component.- Specified by:
setX
in interfaceVectorStorageIntegral2Type
- Parameters:
x
- The X component
-
setY
public void setY(long y) Description copied from interface:VectorStorageIntegral2Type
Set theY
component.- Specified by:
setY
in interfaceVectorStorageIntegral2Type
- Parameters:
y
- The Y component
-
setZ
public void setZ(long z) Description copied from interface:VectorStorageIntegral3Type
Set thez
component.- Specified by:
setZ
in interfaceVectorStorageIntegral3Type
- Parameters:
z
- The Z component
-
setW
public void setW(long w) Description copied from interface:VectorStorageIntegral4Type
Set thew
component.- Specified by:
setW
in interfaceVectorStorageIntegral4Type
- Parameters:
w
- The W component
-
componentBytes
protected final int componentBytes() -
byteBuffer
- Specified by:
byteBuffer
in interfaceTensorByteBufferedType
- Returns:
- The byte buffer that backs the tensor
-
byteOffset
public final long byteOffset()- Specified by:
byteOffset
in interfaceTensorByteBufferedType
- Returns:
- The byte offset of the current tensor
-
offset
public final int offset()- Specified by:
offset
in interfaceTensorByteBufferedType
- Returns:
- A constant offset added to
TensorByteBufferedType.byteOffset()
.
-
sizeBytes
public final int sizeBytes()- Specified by:
sizeBytes
in interfaceTensorByteBufferedType
- Returns:
- The size of a single tensor in bytes
-
byteOffsetForIndex
protected final int byteOffsetForIndex(int component_index)
-