Class CharArrayIndexer

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class CharArrayIndexer
    extends CharIndexer
    An indexer for a char[] array.
    • Constructor Summary

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

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

      • CharArrayIndexer

        public CharArrayIndexer​(char[] array)
        Calls CharArrayIndexer(array, Index.create(array.length)).
      • CharArrayIndexer

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

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

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

      • array

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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