Class UByteBufferIndexer

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class UByteBufferIndexer
    extends UByteIndexer
    An indexer for a ByteBuffer, treated as unsigned.
    • Field Detail

      • buffer

        protected java.nio.ByteBuffer buffer
        The backing buffer.
    • Constructor Detail

      • UByteBufferIndexer

        public UByteBufferIndexer​(java.nio.ByteBuffer buffer)
        Calls UByteBufferIndexer(buffer, Index.create(buffer.limit())).
      • UByteBufferIndexer

        public UByteBufferIndexer​(java.nio.ByteBuffer buffer,
                                  long... sizes)
        Calls UByteBufferIndexer(buffer, Index.create(sizes)).
      • UByteBufferIndexer

        public UByteBufferIndexer​(java.nio.ByteBuffer buffer,
                                  long[] sizes,
                                  long[] strides)
        Calls UByteBufferIndexer(buffer, Index.create(sizes, strides)).
      • UByteBufferIndexer

        public UByteBufferIndexer​(java.nio.ByteBuffer buffer,
                                  Index index)
        Constructor to set the buffer and Indexer.index.
    • Method Detail

      • buffer

        public java.nio.Buffer buffer()
        Description copied from class: Indexer
        Returns the backing buffer, or null if none
        Overrides:
        buffer in class Indexer
      • reindex

        public UByteIndexer reindex​(Index index)
        Description copied from class: Indexer
        Returns a new Indexer using the same data, but with a different Index.
        Specified by:
        reindex in class Indexer
      • get

        public int get​(long i)
        Description copied from class: UByteIndexer
        Returns array/buffer[index(i)]
        Specified by:
        get in class UByteIndexer
      • get

        public UByteIndexer get​(long i,
                                int[] b,
                                int offset,
                                int length)
        Description copied from class: UByteIndexer
        Returns this where b[offset:offset + length] = array/buffer[index(i)]
        Specified by:
        get in class UByteIndexer
      • get

        public int get​(long i,
                       long j)
        Description copied from class: UByteIndexer
        Returns array/buffer[index(i, j)]
        Specified by:
        get in class UByteIndexer
      • get

        public UByteIndexer get​(long i,
                                long j,
                                int[] b,
                                int offset,
                                int length)
        Description copied from class: UByteIndexer
        Returns this where b[offset:offset + length] = array/buffer[index(i, j)]
        Specified by:
        get in class UByteIndexer
      • get

        public int get​(long i,
                       long j,
                       long k)
        Description copied from class: UByteIndexer
        Returns array/buffer[index(i, j, k)]
        Specified by:
        get in class UByteIndexer
      • get

        public int get​(long... indices)
        Description copied from class: UByteIndexer
        Returns array/buffer[index(indices)]
        Specified by:
        get in class UByteIndexer
      • get

        public UByteIndexer get​(long[] indices,
                                int[] b,
                                int offset,
                                int length)
        Description copied from class: UByteIndexer
        Returns this where b[offset:offset + length] = array/buffer[index(indices)]
        Specified by:
        get in class UByteIndexer
      • put

        public UByteIndexer put​(long i,
                                int[] b,
                                int offset,
                                int length)
        Description copied from class: UByteIndexer
        Returns this where array/buffer[index(i)] = b[offset:offset + length]
        Specified by:
        put in class UByteIndexer
      • put

        public UByteIndexer put​(long i,
                                long j,
                                int b)
        Description copied from class: UByteIndexer
        Returns this where array/buffer[index(i, j)] = b
        Specified by:
        put in class UByteIndexer
      • put

        public UByteIndexer put​(long i,
                                long j,
                                int[] b,
                                int offset,
                                int length)
        Description copied from class: UByteIndexer
        Returns this where array/buffer[index(i, j)] = b[offset:offset + length]
        Specified by:
        put in class UByteIndexer
      • put

        public UByteIndexer put​(long i,
                                long j,
                                long k,
                                int b)
        Description copied from class: UByteIndexer
        Returns this where array/buffer[index(i, j, k)] = b
        Specified by:
        put in class UByteIndexer
      • put

        public UByteIndexer put​(long[] indices,
                                int b)
        Description copied from class: UByteIndexer
        Returns this where array/buffer[index(indices)] = b
        Specified by:
        put in class UByteIndexer
      • put

        public UByteIndexer put​(long[] indices,
                                int[] b,
                                int offset,
                                int length)
        Description copied from class: UByteIndexer
        Returns this where array/buffer[index(indices)] = b[offset:offset + length]
        Specified by:
        put in class UByteIndexer
      • release

        public void release()
        Description copied from class: Indexer
        Makes sure changes are reflected onto the backing memory and clears any references.
        Specified by:
        release in class Indexer