public abstract class ByteIndexer extends Indexer
byte primitive type.| 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 |
ByteIndexer(long[] sizes,
long[] strides) |
| Modifier and Type | Method and Description |
|---|---|
static ByteIndexer |
create(byte[] array)
Returns
new ByteArrayIndexer(array) |
static ByteIndexer |
create(byte[] array,
long[] sizes,
long[] strides)
Returns
new ByteArrayIndexer(array, sizes, strides) |
static ByteIndexer |
create(ByteBuffer buffer)
Returns
new ByteBufferIndexer(buffer) |
static ByteIndexer |
create(ByteBuffer buffer,
long[] sizes,
long[] strides)
Returns
new ByteBufferIndexer(buffer, sizes, strides) |
static ByteIndexer |
create(BytePointer pointer)
Returns
create(pointer, { pointer.limit() - pointer.position() }, { 1 }, true) |
static ByteIndexer |
create(BytePointer pointer,
long[] sizes,
long[] strides)
Returns
create(pointer, sizes, strides, true) |
static ByteIndexer |
create(BytePointer pointer,
long[] sizes,
long[] strides,
boolean direct)
Creates a byte indexer to access efficiently the data of a pointer.
|
abstract byte |
get(long... indices)
Returns
array/buffer[index(indices)] |
abstract byte |
get(long i)
Returns
array/buffer[i] |
ByteIndexer |
get(long[] indices,
byte[] b)
Returns
this where b = array/buffer[index(indices)] |
abstract ByteIndexer |
get(long[] indices,
byte[] b,
int offset,
int length)
Returns
this where b[offset:offset + length] = array/buffer[index(indices)] |
ByteIndexer |
get(long i,
byte[] b)
Returns
this where b = array/buffer[i] |
abstract ByteIndexer |
get(long i,
byte[] b,
int offset,
int length)
Returns
this where b[offset:offset + length] = array/buffer[i] |
abstract byte |
get(long i,
long j)
Returns
array/buffer[i * strides[0] + j] |
ByteIndexer |
get(long i,
long j,
byte[] b)
Returns
this where b = array/buffer[i * strides[0] + j] |
abstract ByteIndexer |
get(long i,
long j,
byte[] b,
int offset,
int length)
Returns
this where b[offset:offset + length] = array/buffer[i * strides[0] + j] |
abstract byte |
get(long i,
long j,
long k)
Returns
array/buffer[i * strides[0] + j * strides[1] + k] |
abstract char |
getChar(long i)
Returns the
char value at array/buffer[i] |
double |
getDouble(long... indices)
Calls
get(int...indices) and returns the value as a double. |
abstract double |
getDouble(long i)
Returns the
double value at array/buffer[i] |
abstract float |
getFloat(long i)
Returns the
float value at array/buffer[i] |
abstract int |
getInt(long i)
Returns the
int value at array/buffer[i] |
abstract long |
getLong(long i)
Returns the
long value at array/buffer[i] |
abstract short |
getShort(long i)
Returns the
short value at array/buffer[i] |
ByteIndexer |
put(long[] indices,
byte... b)
Returns
this where array/buffer[index(indices)] = b |
abstract ByteIndexer |
put(long[] indices,
byte b)
Returns
this where array/buffer[index(indices)] = b |
abstract ByteIndexer |
put(long[] indices,
byte[] b,
int offset,
int length)
Returns
this where array/buffer[index(indices)] = b[offset:offset + length] |
ByteIndexer |
put(long i,
byte... b)
Returns
this where array/buffer[i] = b |
abstract ByteIndexer |
put(long i,
byte b)
Returns
this where array/buffer[i] = b |
abstract ByteIndexer |
put(long i,
byte[] b,
int offset,
int length)
Returns
this where array/buffer[i] = b[offset:offset + length] |
ByteIndexer |
put(long i,
long j,
byte... b)
Returns
this where array/buffer[i * strides[0] + j] = b |
abstract ByteIndexer |
put(long i,
long j,
byte b)
Returns
this where array/buffer[i * strides[0] + j] = b |
abstract ByteIndexer |
put(long i,
long j,
byte[] b,
int offset,
int length)
Returns
this where array/buffer[i * strides[0] + j] = b[offset:offset + length] |
abstract ByteIndexer |
put(long i,
long j,
long k,
byte b)
Returns
this where array/buffer[i * strides[0] + j * strides[1] + k] = b |
abstract ByteIndexer |
putChar(long i,
char c)
Sets the
char value at array/buffer[i] |
ByteIndexer |
putDouble(long[] indices,
double b)
Casts value to primitive type and calls
put(long[] indices, <type> value). |
abstract ByteIndexer |
putDouble(long i,
double d)
Sets the
double value at array/buffer[i] |
abstract ByteIndexer |
putFloat(long i,
float f)
Sets the
float value at array/buffer[i] |
abstract ByteIndexer |
putInt(long i,
int j)
Sets the
int value at array/buffer[i] |
abstract ByteIndexer |
putLong(long i,
long j)
Sets the
long value at array/buffer[i] |
abstract ByteIndexer |
putShort(long i,
short s)
Sets the
short value at array/buffer[i] |
public static final int VALUE_BYTES
public static ByteIndexer create(byte[] array)
new ByteArrayIndexer(array)public static ByteIndexer create(ByteBuffer buffer)
new ByteBufferIndexer(buffer)public static ByteIndexer create(BytePointer pointer)
create(pointer, { pointer.limit() - pointer.position() }, { 1 }, true)public static ByteIndexer create(byte[] array, long[] sizes, long[] strides)
new ByteArrayIndexer(array, sizes, strides)public static ByteIndexer create(ByteBuffer buffer, long[] sizes, long[] strides)
new ByteBufferIndexer(buffer, sizes, strides)public static ByteIndexer create(BytePointer pointer, long[] sizes, long[] strides)
create(pointer, sizes, strides, true)public static ByteIndexer 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 byte get(long i)
array/buffer[i]public ByteIndexer get(long i, byte[] b)
this where b = array/buffer[i]public abstract ByteIndexer get(long i, byte[] b, int offset, int length)
this where b[offset:offset + length] = array/buffer[i]public abstract byte get(long i,
long j)
array/buffer[i * strides[0] + j]public ByteIndexer get(long i, long j, byte[] b)
this where b = array/buffer[i * strides[0] + j]public abstract ByteIndexer get(long i, long j, byte[] b, int offset, int length)
this where b[offset:offset + length] = array/buffer[i * strides[0] + j]public abstract byte get(long i,
long j,
long k)
array/buffer[i * strides[0] + j * strides[1] + k]public abstract byte get(long... indices)
array/buffer[index(indices)]public ByteIndexer get(long[] indices, byte[] b)
this where b = array/buffer[index(indices)]public abstract ByteIndexer get(long[] indices, byte[] b, int offset, int length)
this where b[offset:offset + length] = array/buffer[index(indices)]public abstract ByteIndexer put(long i, byte b)
this where array/buffer[i] = bpublic ByteIndexer put(long i, byte... b)
this where array/buffer[i] = bpublic abstract ByteIndexer put(long i, byte[] b, int offset, int length)
this where array/buffer[i] = b[offset:offset + length]public abstract ByteIndexer put(long i, long j, byte b)
this where array/buffer[i * strides[0] + j] = bpublic ByteIndexer put(long i, long j, byte... b)
this where array/buffer[i * strides[0] + j] = bpublic abstract ByteIndexer put(long i, long j, byte[] b, int offset, int length)
this where array/buffer[i * strides[0] + j] = b[offset:offset + length]public abstract ByteIndexer put(long i, long j, long k, byte b)
this where array/buffer[i * strides[0] + j * strides[1] + k] = bpublic abstract ByteIndexer put(long[] indices, byte b)
this where array/buffer[index(indices)] = bpublic ByteIndexer put(long[] indices, byte... b)
this where array/buffer[index(indices)] = bpublic abstract ByteIndexer put(long[] indices, byte[] b, int offset, int length)
this where array/buffer[index(indices)] = b[offset:offset + length]public abstract short getShort(long i)
short value at array/buffer[i]public abstract ByteIndexer putShort(long i, short s)
short value at array/buffer[i]public abstract int getInt(long i)
int value at array/buffer[i]public abstract ByteIndexer putInt(long i, int j)
int value at array/buffer[i]public abstract long getLong(long i)
long value at array/buffer[i]public abstract ByteIndexer putLong(long i, long j)
long value at array/buffer[i]public abstract float getFloat(long i)
float value at array/buffer[i]public abstract ByteIndexer putFloat(long i, float f)
float value at array/buffer[i]public abstract double getDouble(long i)
double value at array/buffer[i]public abstract ByteIndexer putDouble(long i, double d)
double value at array/buffer[i]public abstract char getChar(long i)
char value at array/buffer[i]public abstract ByteIndexer putChar(long i, char c)
char value at array/buffer[i]public double getDouble(long... indices)
Indexerget(int...indices) and returns the value as a double.public ByteIndexer putDouble(long[] indices, double b)
Indexerput(long[] indices, <type> value).Copyright © 2018. All rights reserved.