Package ucar.array

Class Array<T>

    • Method Detail

      • iterator

        public abstract Iterator<T> iterator()
        Iterates in canonical order over all the elements of the Array.
        Specified by:
        iterator in interface Iterable<T>
      • get

        public abstract T get​(int... index)
        Get the element indicated by the list of multidimensional indices.
        Parameters:
        index - list of indices, one for each dimension. For vlen, the last is ignored.
      • get

        public abstract T get​(Index index)
        Get the element indicated by Index.
        Parameters:
        index - multidimensional indices.
      • getScalar

        public T getScalar()
        Get the first element of the Array
      • getArrayType

        public ArrayType getArrayType()
        The ArrayType for this Array. Note that ArrayType.CHAR is represented by an Array<Byte>.
      • isVlen

        public boolean isVlen()
        Is variable length and will be represented by Vlen<T>
      • getIndex

        public Index getIndex()
        An Index that can be used instead of int[], with the same rank as this Array.
      • getRank

        public int getRank()
        Get the number of dimensions of the array.
      • getShape

        public int[] getShape()
        Get the shape: length of array in each dimension. Use Ints.asList() to convert to List of Integer
      • getSize

        public long getSize()
        Get the total Number of elements
      • getSection

        public Section getSection()
        Get the section: list of Ranges, one for each dimension.
      • length

        public long length()
        Get the total number of elements in the array. Excludes vlen dimensins.
      • equals

        public boolean equals​(Object o)
        Equal if the type and indexFn are equal, doesnt test the contents.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Consistent with equals.
        Overrides:
        hashCode in class Object
      • contains

        public boolean contains​(int... index)
        Check if the given index is valid.