Package ucar.ma2

Class SectionIterable

  • All Implemented Interfaces:
    Iterable<Integer>

    @Immutable
    public class SectionIterable
    extends Object
    implements Iterable<Integer>
    A Section composed of List instead of List. SectionIterable knows the fullShape of which it is a section. The iteration is over the elements in the section, returning 1D index into the full shape.
    Since:
    8/23/2015
    • Constructor Detail

      • SectionIterable

        public SectionIterable​(List<RangeIterator> ranges,
                               int[] fullShape)
      • SectionIterable

        public SectionIterable​(Section section,
                               int[] fullShape)
    • Method Detail

      • getRank

        public int getRank()
      • subSection

        public SectionIterable subSection​(int start,
                                          int endExclusive)
      • getShape

        public int[] getShape()
      • computeSize

        public long computeSize()
      • getIterator

        public SectionIterable.SectionIterator getIterator()
        Iterate over a section, returning the index in an equivalent 1D array of shape[] So this is a section in a (possibly) larger array described by shape[]. The index is in the "source" array.
        Returns:
        iterator over this section