Package ucar.ma2

Class IndexConstant

  • All Implemented Interfaces:
    Cloneable

    public class IndexConstant
    extends Index
    An Index into an Array that always returns 0. It can have any shape, so it allows you to create a constant Array of any shape.
    • Constructor Detail

      • IndexConstant

        protected IndexConstant​(int rank)
      • IndexConstant

        protected IndexConstant​(int[] shape)
      • IndexConstant

        protected IndexConstant​(int[] shape,
                                int[] stride)
    • Method Detail

      • currentElement

        public int currentElement()
        always return 0
        Overrides:
        currentElement in class Index
        Returns:
        the current element's index into the 1D backing array.