Class LongArrayIndexer

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class LongArrayIndexer
    extends LongIndexer
    An indexer for a long[] array.
    • Constructor Summary

      Constructors 
      Constructor Description
      LongArrayIndexer​(long[] array)
      Calls LongArrayIndexer(array, Index.create(array.length)).
      LongArrayIndexer​(long[] array, long... sizes)
      Calls LongArrayIndexer(array, Index.create(sizes)).
      LongArrayIndexer​(long[] array, long[] sizes, long[] strides)
      Calls LongArrayIndexer(array, Index.create(sizes, strides)).
      LongArrayIndexer​(long[] array, Index index)
      Constructor to set the array and Indexer.index.
    • Method Summary

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

      • array

        protected long[] array
        The backing array.
    • Constructor Detail

      • LongArrayIndexer

        public LongArrayIndexer​(long[] array)
        Calls LongArrayIndexer(array, Index.create(array.length)).
      • LongArrayIndexer

        public LongArrayIndexer​(long[] array,
                                long... sizes)
        Calls LongArrayIndexer(array, Index.create(sizes)).
      • LongArrayIndexer

        public LongArrayIndexer​(long[] array,
                                long[] sizes,
                                long[] strides)
        Calls LongArrayIndexer(array, Index.create(sizes, strides)).
      • LongArrayIndexer

        public LongArrayIndexer​(long[] array,
                                Index index)
        Constructor to set the array and Indexer.index.
    • Method Detail

      • array

        public long[] array()
        Description copied from class: Indexer
        Returns the backing array, or null if none
        Overrides:
        array in class Indexer
      • reindex

        public LongIndexer 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 long get​(long i)
        Description copied from class: LongIndexer
        Returns array/buffer[index(i)]
        Specified by:
        get in class LongIndexer
      • get

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

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

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

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

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

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

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

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

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

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

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

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

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