Package org.bytedeco.javacpp.indexer
Class ByteRawIndexer
- java.lang.Object
-
- org.bytedeco.javacpp.indexer.Indexer
-
- org.bytedeco.javacpp.indexer.ByteIndexer
-
- org.bytedeco.javacpp.indexer.ByteRawIndexer
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class ByteRawIndexer extends ByteIndexer
An indexer for aBytePointer
using theRaw
instance.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) long
base
Base address and number of elements accessible.protected BytePointer
pointer
The backing pointer.protected static Raw
RAW
The instance for the raw memory interface.(package private) long
size
Base address and number of elements accessible.-
Fields inherited from class org.bytedeco.javacpp.indexer.ByteIndexer
VALUE_BYTES
-
-
Constructor Summary
Constructors Constructor Description ByteRawIndexer(BytePointer pointer)
CallsByteRawIndexer(pointer, Index.create(pointer.limit() - pointer.position()))
.ByteRawIndexer(BytePointer pointer, long... sizes)
CallsByteRawIndexer(pointer, Index.create(sizes))
.ByteRawIndexer(BytePointer pointer, long[] sizes, long[] strides)
CallsByteRawIndexer(pointer, Index.create(sizes, strides))
.ByteRawIndexer(BytePointer pointer, Index index)
Constructor to set thepointer
andIndexer.index
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
get(long i)
Returnsarray/buffer[index(i)]
byte
get(long... indices)
Returnsarray/buffer[index(indices)]
ByteIndexer
get(long[] indices, byte[] b, int offset, int length)
Returnsthis
whereb[offset:offset + length] = array/buffer[index(indices)]
ByteIndexer
get(long i, byte[] b, int offset, int length)
Returnsthis
whereb[offset:offset + length] = array/buffer[index(i)]
byte
get(long i, long j)
Returnsarray/buffer[index(i, j)]
ByteIndexer
get(long i, long j, byte[] b, int offset, int length)
Returnsthis
whereb[offset:offset + length] = array/buffer[index(i, j)]
byte
get(long i, long j, long k)
Returnsarray/buffer[index(i, j, k)]
byte
getByte(long i)
Returns thebyte
value atarray/buffer[i]
char
getChar(long i)
Returns thechar
value atarray/buffer[i]
double
getDouble(long i)
Returns thedouble
value atarray/buffer[i]
float
getFloat(long i)
Returns thefloat
value atarray/buffer[i]
int
getInt(long i)
Returns theint
value atarray/buffer[i]
long
getLong(long i)
Returns thelong
value atarray/buffer[i]
byte
getRaw(long i)
short
getShort(long i)
Returns theshort
value atarray/buffer[i]
Pointer
pointer()
Returns the backing pointer, ornull
if noneByteIndexer
put(long[] indices, byte b)
Returnsthis
wherearray/buffer[index(indices)] = b
ByteIndexer
put(long[] indices, byte[] b, int offset, int length)
Returnsthis
wherearray/buffer[index(indices)] = b[offset:offset + length]
ByteIndexer
put(long i, byte b)
Returnsthis
wherearray/buffer[index(i)] = b
ByteIndexer
put(long i, byte[] b, int offset, int length)
Returnsthis
wherearray/buffer[index(i)] = b[offset:offset + length]
ByteIndexer
put(long i, long j, byte b)
Returnsthis
wherearray/buffer[index(i, j)] = b
ByteIndexer
put(long i, long j, byte[] b, int offset, int length)
Returnsthis
wherearray/buffer[index(i, j)] = b[offset:offset + length]
ByteIndexer
put(long i, long j, long k, byte b)
Returnsthis
wherearray/buffer[index(i, j, k)] = b
ByteIndexer
putByte(long i, byte b)
Sets thebyte
value atarray/buffer[i]
ByteIndexer
putChar(long i, char c)
Sets thechar
value atarray/buffer[i]
ByteIndexer
putDouble(long i, double d)
Sets thedouble
value atarray/buffer[i]
ByteIndexer
putFloat(long i, float f)
Sets thefloat
value atarray/buffer[i]
ByteIndexer
putInt(long i, int j)
Sets theint
value atarray/buffer[i]
ByteIndexer
putLong(long i, long j)
Sets thelong
value atarray/buffer[i]
ByteIndexer
putRaw(long i, byte b)
ByteIndexer
putShort(long i, short s)
Sets theshort
value atarray/buffer[i]
ByteIndexer
reindex(Index index)
Returns a new Indexer using the same data, but with a different Index.void
release()
Makes sure changes are reflected onto the backing memory and clears any references.-
Methods inherited from class org.bytedeco.javacpp.indexer.ByteIndexer
create, create, create, create, create, create, create, create, create, create, create, create, create, create, get, get, get, getBfloat16, getBoolean, getDouble, getHalf, getUByte, getUInt, getULong, getUShort, put, put, put, putBfloat16, putBoolean, putDouble, putHalf, putUByte, putUInt, putULong, putUShort
-
-
-
-
Field Detail
-
RAW
protected static final Raw RAW
The instance for the raw memory interface.
-
pointer
protected BytePointer pointer
The backing pointer.
-
base
final long base
Base address and number of elements accessible.
-
size
final long size
Base address and number of elements accessible.
-
-
Constructor Detail
-
ByteRawIndexer
public ByteRawIndexer(BytePointer pointer)
CallsByteRawIndexer(pointer, Index.create(pointer.limit() - pointer.position()))
.
-
ByteRawIndexer
public ByteRawIndexer(BytePointer pointer, long... sizes)
CallsByteRawIndexer(pointer, Index.create(sizes))
.
-
ByteRawIndexer
public ByteRawIndexer(BytePointer pointer, long[] sizes, long[] strides)
CallsByteRawIndexer(pointer, Index.create(sizes, strides))
.
-
ByteRawIndexer
public ByteRawIndexer(BytePointer pointer, Index index)
Constructor to set thepointer
andIndexer.index
.
-
-
Method Detail
-
pointer
public Pointer pointer()
Description copied from class:Indexer
Returns the backing pointer, ornull
if none
-
reindex
public ByteIndexer reindex(Index index)
Description copied from class:Indexer
Returns a new Indexer using the same data, but with a different Index.
-
getRaw
public byte getRaw(long i)
-
get
public byte get(long i)
Description copied from class:ByteIndexer
Returnsarray/buffer[index(i)]
- Specified by:
get
in classByteIndexer
-
get
public ByteIndexer get(long i, byte[] b, int offset, int length)
Description copied from class:ByteIndexer
Returnsthis
whereb[offset:offset + length] = array/buffer[index(i)]
- Specified by:
get
in classByteIndexer
-
get
public byte get(long i, long j)
Description copied from class:ByteIndexer
Returnsarray/buffer[index(i, j)]
- Specified by:
get
in classByteIndexer
-
get
public ByteIndexer get(long i, long j, byte[] b, int offset, int length)
Description copied from class:ByteIndexer
Returnsthis
whereb[offset:offset + length] = array/buffer[index(i, j)]
- Specified by:
get
in classByteIndexer
-
get
public byte get(long i, long j, long k)
Description copied from class:ByteIndexer
Returnsarray/buffer[index(i, j, k)]
- Specified by:
get
in classByteIndexer
-
get
public byte get(long... indices)
Description copied from class:ByteIndexer
Returnsarray/buffer[index(indices)]
- Specified by:
get
in classByteIndexer
-
get
public ByteIndexer get(long[] indices, byte[] b, int offset, int length)
Description copied from class:ByteIndexer
Returnsthis
whereb[offset:offset + length] = array/buffer[index(indices)]
- Specified by:
get
in classByteIndexer
-
putRaw
public ByteIndexer putRaw(long i, byte b)
-
put
public ByteIndexer put(long i, byte b)
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(i)] = b
- Specified by:
put
in classByteIndexer
-
put
public ByteIndexer put(long i, byte[] b, int offset, int length)
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(i)] = b[offset:offset + length]
- Specified by:
put
in classByteIndexer
-
put
public ByteIndexer put(long i, long j, byte b)
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(i, j)] = b
- Specified by:
put
in classByteIndexer
-
put
public ByteIndexer put(long i, long j, byte[] b, int offset, int length)
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(i, j)] = b[offset:offset + length]
- Specified by:
put
in classByteIndexer
-
put
public ByteIndexer put(long i, long j, long k, byte b)
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(i, j, k)] = b
- Specified by:
put
in classByteIndexer
-
put
public ByteIndexer put(long[] indices, byte b)
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(indices)] = b
- Specified by:
put
in classByteIndexer
-
put
public ByteIndexer put(long[] indices, byte[] b, int offset, int length)
Description copied from class:ByteIndexer
Returnsthis
wherearray/buffer[index(indices)] = b[offset:offset + length]
- Specified by:
put
in classByteIndexer
-
getByte
public byte getByte(long i)
Description copied from class:ByteIndexer
Returns thebyte
value atarray/buffer[i]
- Specified by:
getByte
in classByteIndexer
-
putByte
public ByteIndexer putByte(long i, byte b)
Description copied from class:ByteIndexer
Sets thebyte
value atarray/buffer[i]
- Specified by:
putByte
in classByteIndexer
-
getShort
public short getShort(long i)
Description copied from class:ByteIndexer
Returns theshort
value atarray/buffer[i]
- Specified by:
getShort
in classByteIndexer
-
putShort
public ByteIndexer putShort(long i, short s)
Description copied from class:ByteIndexer
Sets theshort
value atarray/buffer[i]
- Specified by:
putShort
in classByteIndexer
-
getInt
public int getInt(long i)
Description copied from class:ByteIndexer
Returns theint
value atarray/buffer[i]
- Specified by:
getInt
in classByteIndexer
-
putInt
public ByteIndexer putInt(long i, int j)
Description copied from class:ByteIndexer
Sets theint
value atarray/buffer[i]
- Specified by:
putInt
in classByteIndexer
-
getLong
public long getLong(long i)
Description copied from class:ByteIndexer
Returns thelong
value atarray/buffer[i]
- Specified by:
getLong
in classByteIndexer
-
putLong
public ByteIndexer putLong(long i, long j)
Description copied from class:ByteIndexer
Sets thelong
value atarray/buffer[i]
- Specified by:
putLong
in classByteIndexer
-
getFloat
public float getFloat(long i)
Description copied from class:ByteIndexer
Returns thefloat
value atarray/buffer[i]
- Specified by:
getFloat
in classByteIndexer
-
putFloat
public ByteIndexer putFloat(long i, float f)
Description copied from class:ByteIndexer
Sets thefloat
value atarray/buffer[i]
- Specified by:
putFloat
in classByteIndexer
-
getDouble
public double getDouble(long i)
Description copied from class:ByteIndexer
Returns thedouble
value atarray/buffer[i]
- Specified by:
getDouble
in classByteIndexer
-
putDouble
public ByteIndexer putDouble(long i, double d)
Description copied from class:ByteIndexer
Sets thedouble
value atarray/buffer[i]
- Specified by:
putDouble
in classByteIndexer
-
getChar
public char getChar(long i)
Description copied from class:ByteIndexer
Returns thechar
value atarray/buffer[i]
- Specified by:
getChar
in classByteIndexer
-
putChar
public ByteIndexer putChar(long i, char c)
Description copied from class:ByteIndexer
Sets thechar
value atarray/buffer[i]
- Specified by:
putChar
in classByteIndexer
-
-