public abstract class UByteIndexer extends Indexer
byte
primitive type, treated as unsigned.Modifier and Type | Field and Description |
---|---|
static int |
VALUE_BYTES
The number of bytes used to represent a byte.
|
indexable, ONE_STRIDE, sizes, strides
Modifier | Constructor and Description |
---|---|
protected |
UByteIndexer(long[] sizes,
long[] strides) |
Modifier and Type | Method and Description |
---|---|
static UByteIndexer |
create(byte[] array)
Returns
new ByteArrayIndexer(array) |
static UByteIndexer |
create(byte[] array,
long... sizes)
Returns
new UByteArrayIndexer(array, sizes) |
static UByteIndexer |
create(byte[] array,
long[] sizes,
long[] strides)
Returns
new ByteArrayIndexer(array, sizes, strides) |
static UByteIndexer |
create(ByteBuffer buffer)
Returns
new ByteBufferIndexer(buffer) |
static UByteIndexer |
create(ByteBuffer buffer,
long... sizes)
Returns
new UByteBufferIndexer(buffer, sizes) |
static UByteIndexer |
create(ByteBuffer buffer,
long[] sizes,
long[] strides)
Returns
new ByteBufferIndexer(buffer, sizes, strides) |
static UByteIndexer |
create(BytePointer pointer)
Returns
create(pointer, { pointer.limit() - pointer.position() }, { 1 }, true) |
static UByteIndexer |
create(BytePointer pointer,
long... sizes)
Returns
create(pointer, sizes, strides(sizes)) |
static UByteIndexer |
create(BytePointer pointer,
long[] sizes,
long[] strides)
Returns
create(pointer, sizes, strides, true) |
static UByteIndexer |
create(BytePointer pointer,
long[] sizes,
long[] strides,
boolean direct)
Creates a byte indexer to access efficiently the data of a pointer.
|
abstract int |
get(long... indices)
Returns
array/buffer[index(indices)] |
abstract int |
get(long i)
Returns
array/buffer[i] |
UByteIndexer |
get(long[] indices,
int[] b)
Returns
this where b = array/buffer[index(indices)] |
abstract UByteIndexer |
get(long[] indices,
int[] b,
int offset,
int length)
Returns
this where b[offset:offset + length] = array/buffer[index(indices)] |
UByteIndexer |
get(long i,
int[] b)
Returns
this where b = array/buffer[i] |
abstract UByteIndexer |
get(long i,
int[] b,
int offset,
int length)
Returns
this where b[offset:offset + length] = array/buffer[i] |
abstract int |
get(long i,
long j)
Returns
array/buffer[i * strides[0] + j] |
UByteIndexer |
get(long i,
long j,
int[] b)
Returns
this where b = array/buffer[i * strides[0] + j] |
abstract UByteIndexer |
get(long i,
long j,
int[] b,
int offset,
int length)
Returns
this where b[offset:offset + length] = array/buffer[i * strides[0] + j] |
abstract int |
get(long i,
long j,
long k)
Returns
array/buffer[i * strides[0] + j * strides[1] + k] |
double |
getDouble(long... indices)
Calls
get(int...indices) and returns the value as a double. |
UByteIndexer |
put(long[] indices,
int... b)
Returns
this where array/buffer[index(indices)] = b |
abstract UByteIndexer |
put(long[] indices,
int b)
Returns
this where array/buffer[index(indices)] = b |
abstract UByteIndexer |
put(long[] indices,
int[] b,
int offset,
int length)
Returns
this where array/buffer[index(indices)] = b[offset:offset + length] |
UByteIndexer |
put(long i,
int... b)
Returns
this where array/buffer[i] = b |
abstract UByteIndexer |
put(long i,
int b)
Returns
this where array/buffer[i] = b |
abstract UByteIndexer |
put(long i,
int[] b,
int offset,
int length)
Returns
this where array/buffer[i] = b[offset:offset + length] |
UByteIndexer |
put(long i,
long j,
int... b)
Returns
this where array/buffer[i * strides[0] + j] = b |
abstract UByteIndexer |
put(long i,
long j,
int b)
Returns
this where array/buffer[i * strides[0] + j] = b |
abstract UByteIndexer |
put(long i,
long j,
int[] b,
int offset,
int length)
Returns
this where array/buffer[i * strides[0] + j] = b[offset:offset + length] |
abstract UByteIndexer |
put(long i,
long j,
long k,
int b)
Returns
this where array/buffer[i * strides[0] + j * strides[1] + k] = b |
UByteIndexer |
putDouble(long[] indices,
double b)
Casts value to primitive type and calls
put(long[] indices, <type> value) . |
public static final int VALUE_BYTES
public static UByteIndexer create(byte[] array)
new ByteArrayIndexer(array)
public static UByteIndexer create(ByteBuffer buffer)
new ByteBufferIndexer(buffer)
public static UByteIndexer create(BytePointer pointer)
create(pointer, { pointer.limit() - pointer.position() }, { 1 }, true)
public static UByteIndexer create(byte[] array, long... sizes)
new UByteArrayIndexer(array, sizes)
public static UByteIndexer create(ByteBuffer buffer, long... sizes)
new UByteBufferIndexer(buffer, sizes)
public static UByteIndexer create(BytePointer pointer, long... sizes)
create(pointer, sizes, strides(sizes))
public static UByteIndexer create(byte[] array, long[] sizes, long[] strides)
new ByteArrayIndexer(array, sizes, strides)
public static UByteIndexer create(ByteBuffer buffer, long[] sizes, long[] strides)
new ByteBufferIndexer(buffer, sizes, strides)
public static UByteIndexer create(BytePointer pointer, long[] sizes, long[] strides)
create(pointer, sizes, strides, true)
public static UByteIndexer create(BytePointer pointer, long[] sizes, long[] strides, boolean direct)
pointer
- data to access via a buffer or to copy to an arraydirect
- true
to use a direct buffer, see Indexer
for detailspublic abstract int get(long i)
array/buffer[i]
public UByteIndexer get(long i, int[] b)
this
where b = array/buffer[i]
public abstract UByteIndexer get(long i, int[] b, int offset, int length)
this
where b[offset:offset + length] = array/buffer[i]
public abstract int get(long i, long j)
array/buffer[i * strides[0] + j]
public UByteIndexer get(long i, long j, int[] b)
this
where b = array/buffer[i * strides[0] + j]
public abstract UByteIndexer get(long i, long j, int[] b, int offset, int length)
this
where b[offset:offset + length] = array/buffer[i * strides[0] + j]
public abstract int get(long i, long j, long k)
array/buffer[i * strides[0] + j * strides[1] + k]
public abstract int get(long... indices)
array/buffer[index(indices)]
public UByteIndexer get(long[] indices, int[] b)
this
where b = array/buffer[index(indices)]
public abstract UByteIndexer get(long[] indices, int[] b, int offset, int length)
this
where b[offset:offset + length] = array/buffer[index(indices)]
public abstract UByteIndexer put(long i, int b)
this
where array/buffer[i] = b
public UByteIndexer put(long i, int... b)
this
where array/buffer[i] = b
public abstract UByteIndexer put(long i, int[] b, int offset, int length)
this
where array/buffer[i] = b[offset:offset + length]
public abstract UByteIndexer put(long i, long j, int b)
this
where array/buffer[i * strides[0] + j] = b
public UByteIndexer put(long i, long j, int... b)
this
where array/buffer[i * strides[0] + j] = b
public abstract UByteIndexer put(long i, long j, int[] b, int offset, int length)
this
where array/buffer[i * strides[0] + j] = b[offset:offset + length]
public abstract UByteIndexer put(long i, long j, long k, int b)
this
where array/buffer[i * strides[0] + j * strides[1] + k] = b
public abstract UByteIndexer put(long[] indices, int b)
this
where array/buffer[index(indices)] = b
public UByteIndexer put(long[] indices, int... b)
this
where array/buffer[index(indices)] = b
public abstract UByteIndexer put(long[] indices, int[] b, int offset, int length)
this
where array/buffer[index(indices)] = b[offset:offset + length]
public double getDouble(long... indices)
Indexer
get(int...indices)
and returns the value as a double.public UByteIndexer putDouble(long[] indices, double b)
Indexer
put(long[] indices, <type> value)
.Copyright © 2020. All rights reserved.