Package ucar.ma2

Class SectionIterable

java.lang.Object
ucar.ma2.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 Details

    • SectionIterable

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

      public SectionIterable(List<RangeIterator> ranges, List<Integer> fullShapeList)
    • SectionIterable

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

    • getRank

      public int getRank()
    • subSection

      public SectionIterable subSection(int start, int endExclusive)
    • getRange

      public RangeIterator getRange(int i)
    • getShape

      public int[] getShape()
    • computeSize

      public long computeSize()
    • iterator

      public Iterator<Integer> iterator()
      Specified by:
      iterator in interface Iterable<Integer>
    • 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