Package ucar.ma2

Class Index1D

  • All Implemented Interfaces:
    Cloneable

    public class Index1D
    extends Index
    Specialization of Index for rank 1 arrays.
    See Also:
    Index
    • Constructor Detail

      • Index1D

        public Index1D​(int[] shape)
    • Method Detail

      • precalc

        protected void precalc()
        Description copied from class: Index
        subclass specialization/optimization calculations
        Overrides:
        precalc in class Index
      • getCurrentCounter

        public int[] getCurrentCounter()
        Description copied from class: Index
        Get the current counter.
        Overrides:
        getCurrentCounter in class Index
        Returns:
        copy of the current counter.
      • currentElement

        public int currentElement()
        Description copied from class: Index
        Get the current element's index into the 1D backing array. VLEN stops processing.
        Overrides:
        currentElement in class Index
        Returns:
        the current element's index into the 1D backing array.
      • incr

        public int incr()
        Description copied from class: Index
        Increment the current element by 1. Used by IndexIterator. General rank, with subclass specialization. Vlen skipped.
        Overrides:
        incr in class Index
        Returns:
        currentElement()
      • setDim

        public void setDim​(int dim,
                           int value)
        Description copied from class: Index
        set current element at dimension dim to v
        Overrides:
        setDim in class Index
        Parameters:
        dim - set this dimension
        value - to this value
      • set0

        public Index set0​(int v)
        Description copied from class: Index
        set current element at dimension 0 to v
        Overrides:
        set0 in class Index
        Parameters:
        v - set 0th dimension index to this value
        Returns:
        this, so you can use A.get(i.set(i))
      • set

        public Index set​(int v0)
        Description copied from class: Index
        set current element at dimension 0 to v0
        Overrides:
        set in class Index
        Parameters:
        v0 - set dimension 0 index to this value
        Returns:
        this, so you can use A.get(i.set(i))
      • set

        public Index set​(int[] index)
        Description copied from class: Index
        Set the current element's index. General-rank case.
        Overrides:
        set in class Index
        Parameters:
        index - set current value to these values
        Returns:
        this, so you can use A.get(i.set(i))