org.eclipse.january.dataset

## Class DiscontiguousIterator

- java.lang.Object
- - org.eclipse.january.dataset.IndexIterator
  - - org.eclipse.january.dataset.DiscontiguousIterator

-     public class DiscontiguousIterator
      extends IndexIterator

  Class to run over non-contiguous or fragmented datasets

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.january.dataset.IndexIterator

      `index`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DiscontiguousIterator(int[] shape, int[] dataShape, int length)` Constructor for an iterator over the elements of a dataset that are within the dimensions
    `DiscontiguousIterator(int[] shape, int[] dataShape, int length, int isize)` Constructor for an iterator over the elements of a dataset that are within the dimensions

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int[]` | `getPos()`
    `int[]` | `getShape()`
    `boolean` | `hasNext()`
    `void` | `reset()` Reset iterator

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DiscontiguousIterator

          public DiscontiguousIterator(int[] shape,
                               int[] dataShape,
                               int length)

      Constructor for an iterator over the elements of a dataset that are within the dimensions
      Parameters:
        `shape` -
        `dataShape` -
        `length` - of entire data array

    - #### DiscontiguousIterator

          public DiscontiguousIterator(int[] shape,
                               int[] dataShape,
                               int length,
                               int isize)

      Constructor for an iterator over the elements of a dataset that are within the dimensions
      Parameters:
        `shape` -
        `dataShape` -
        `length` - of entire data array
        `isize` - number of elements in an item

  - ### Method Detail

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in class `IndexIterator`
      Returns:
        true if there is another iteration

    - #### getPos

          public int[] getPos()

      Specified by:
        `getPos` in class `IndexIterator`
      Returns:
        position indices (nb this is reference not a copy so avoid changing and can be null)

    - #### reset

          public void reset()

      Description copied from class: `IndexIterator`
      Reset iterator
      Specified by:
        `reset` in class `IndexIterator`

    - #### getShape

          public int[] getShape()

      Overrides:
        `getShape` in class `IndexIterator`
      Returns:
        shape of iterator (can be null, if not known or applicable)

Copyright © 2017. All rights reserved.