Class IntBufferIndexer

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class IntBufferIndexer
    extends IntIndexer
    An indexer for an IntBuffer.
    • Constructor Summary

      Constructors 
      Constructor Description
      IntBufferIndexer​(java.nio.IntBuffer buffer)
      Calls IntBufferIndexer(buffer, Index.create(buffer.limit())).
      IntBufferIndexer​(java.nio.IntBuffer buffer, long... sizes)
      Calls IntBufferIndexer(buffer, Index.create(sizes)).
      IntBufferIndexer​(java.nio.IntBuffer buffer, long[] sizes, long[] strides)
      Calls IntBufferIndexer(buffer, Index.create(sizes, strides)).
      IntBufferIndexer​(java.nio.IntBuffer buffer, Index index)
      Constructor to set the buffer and Indexer.index.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.nio.Buffer buffer()
      Returns the backing buffer, or null if none
      int get​(long i)
      Returns array/buffer[index(i)]
      int get​(long... indices)
      Returns array/buffer[index(indices)]
      IntIndexer get​(long[] indices, int[] m, int offset, int length)
      Returns this where n[offset:offset + length] = array/buffer[index(indices)]
      IntIndexer get​(long i, int[] m, int offset, int length)
      Returns this where n[offset:offset + length] = array/buffer[index(i)]
      int get​(long i, long j)
      Returns array/buffer[index(i, j)]
      IntIndexer get​(long i, long j, int[] m, int offset, int length)
      Returns this where n[offset:offset + length] = array/buffer[index(i, j)]
      int get​(long i, long j, long k)
      Returns array/buffer[index(i, j, k)]
      IntIndexer put​(long[] indices, int n)
      Returns this where array/buffer[index(indices)] = n
      IntIndexer put​(long[] indices, int[] m, int offset, int length)
      Returns this where array/buffer[index(indices)] = n[offset:offset + length]
      IntIndexer put​(long i, int n)
      Returns this where array/buffer[index(i)] = n
      IntIndexer put​(long i, int[] m, int offset, int length)
      Returns this where array/buffer[index(i)] = n[offset:offset + length]
      IntIndexer put​(long i, long j, int n)
      Returns this where array/buffer[index(i, j)] = n
      IntIndexer put​(long i, long j, int[] m, int offset, int length)
      Returns this where array/buffer[index(i, j)] = n[offset:offset + length]
      IntIndexer put​(long i, long j, long k, int n)
      Returns this where array/buffer[index(i, j, k)] = n
      IntIndexer 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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • buffer

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

      • IntBufferIndexer

        public IntBufferIndexer​(java.nio.IntBuffer buffer)
        Calls IntBufferIndexer(buffer, Index.create(buffer.limit())).
      • IntBufferIndexer

        public IntBufferIndexer​(java.nio.IntBuffer buffer,
                                long... sizes)
        Calls IntBufferIndexer(buffer, Index.create(sizes)).
      • IntBufferIndexer

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

        public IntBufferIndexer​(java.nio.IntBuffer 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 IntIndexer 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: IntIndexer
        Returns array/buffer[index(i)]
        Specified by:
        get in class IntIndexer
      • get

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

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

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

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

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

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

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

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

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

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

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

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

        public IntIndexer put​(long[] indices,
                              int[] m,
                              int offset,
                              int length)
        Description copied from class: IntIndexer
        Returns this where array/buffer[index(indices)] = n[offset:offset + length]
        Specified by:
        put in class IntIndexer
      • 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