public class UByteBufferIndexer extends UByteIndexer
ByteBuffer
, treated as unsigned.Modifier and Type | Field and Description |
---|---|
protected ByteBuffer |
buffer
The backing buffer.
|
VALUE_BYTES
Constructor and Description |
---|
UByteBufferIndexer(ByteBuffer buffer)
Calls
UByteBufferIndexer(buffer, Index.create(buffer.limit())) . |
UByteBufferIndexer(ByteBuffer buffer,
Index index)
Constructor to set the
buffer and Indexer.index . |
UByteBufferIndexer(ByteBuffer buffer,
long... sizes)
Calls
UByteBufferIndexer(buffer, Index.create(sizes)) . |
UByteBufferIndexer(ByteBuffer buffer,
long[] sizes,
long[] strides)
Calls
UByteBufferIndexer(buffer, Index.create(sizes, strides)) . |
Modifier and Type | Method and Description |
---|---|
Buffer |
buffer()
Returns the backing buffer, or
null if none |
int |
get(long... indices)
Returns
array/buffer[index(indices)] |
int |
get(long i)
Returns
array/buffer[index(i)] |
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,
int offset,
int length)
Returns
this where b[offset:offset + length] = array/buffer[index(i)] |
int |
get(long i,
long j)
Returns
array/buffer[index(i, j)] |
UByteIndexer |
get(long i,
long j,
int[] b,
int offset,
int length)
Returns
this where b[offset:offset + length] = array/buffer[index(i, j)] |
int |
get(long i,
long j,
long k)
Returns
array/buffer[index(i, j, k)] |
UByteIndexer |
put(long[] indices,
int b)
Returns
this where array/buffer[index(indices)] = b |
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[index(i)] = b |
UByteIndexer |
put(long i,
int[] b,
int offset,
int length)
Returns
this where array/buffer[index(i)] = b[offset:offset + length] |
UByteIndexer |
put(long i,
long j,
int b)
Returns
this where array/buffer[index(i, j)] = b |
UByteIndexer |
put(long i,
long j,
int[] b,
int offset,
int length)
Returns
this where array/buffer[index(i, j)] = b[offset:offset + length] |
UByteIndexer |
put(long i,
long j,
long k,
int b)
Returns
this where array/buffer[index(i, j, k)] = b |
UByteIndexer |
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.
|
create, create, create, create, create, create, create, create, create, create, create, create, create, create, get, get, get, getDouble, put, put, put, putDouble
protected ByteBuffer buffer
public UByteBufferIndexer(ByteBuffer buffer)
UByteBufferIndexer(buffer, Index.create(buffer.limit()))
.public UByteBufferIndexer(ByteBuffer buffer, long... sizes)
UByteBufferIndexer(buffer, Index.create(sizes))
.public UByteBufferIndexer(ByteBuffer buffer, long[] sizes, long[] strides)
UByteBufferIndexer(buffer, Index.create(sizes, strides))
.public UByteBufferIndexer(ByteBuffer buffer, Index index)
buffer
and Indexer.index
.public Buffer buffer()
Indexer
null
if nonepublic UByteIndexer reindex(Index index)
Indexer
public int get(long i)
UByteIndexer
array/buffer[index(i)]
get
in class UByteIndexer
public UByteIndexer get(long i, int[] b, int offset, int length)
UByteIndexer
this
where b[offset:offset + length] = array/buffer[index(i)]
get
in class UByteIndexer
public int get(long i, long j)
UByteIndexer
array/buffer[index(i, j)]
get
in class UByteIndexer
public UByteIndexer get(long i, long j, int[] b, int offset, int length)
UByteIndexer
this
where b[offset:offset + length] = array/buffer[index(i, j)]
get
in class UByteIndexer
public int get(long i, long j, long k)
UByteIndexer
array/buffer[index(i, j, k)]
get
in class UByteIndexer
public int get(long... indices)
UByteIndexer
array/buffer[index(indices)]
get
in class UByteIndexer
public UByteIndexer get(long[] indices, int[] b, int offset, int length)
UByteIndexer
this
where b[offset:offset + length] = array/buffer[index(indices)]
get
in class UByteIndexer
public UByteIndexer put(long i, int b)
UByteIndexer
this
where array/buffer[index(i)] = b
put
in class UByteIndexer
public UByteIndexer put(long i, int[] b, int offset, int length)
UByteIndexer
this
where array/buffer[index(i)] = b[offset:offset + length]
put
in class UByteIndexer
public UByteIndexer put(long i, long j, int b)
UByteIndexer
this
where array/buffer[index(i, j)] = b
put
in class UByteIndexer
public UByteIndexer put(long i, long j, int[] b, int offset, int length)
UByteIndexer
this
where array/buffer[index(i, j)] = b[offset:offset + length]
put
in class UByteIndexer
public UByteIndexer put(long i, long j, long k, int b)
UByteIndexer
this
where array/buffer[index(i, j, k)] = b
put
in class UByteIndexer
public UByteIndexer put(long[] indices, int b)
UByteIndexer
this
where array/buffer[index(indices)] = b
put
in class UByteIndexer
public UByteIndexer put(long[] indices, int[] b, int offset, int length)
UByteIndexer
this
where array/buffer[index(indices)] = b[offset:offset + length]
put
in class UByteIndexer
Copyright © 2024. All rights reserved.