org.eclipse.january.dataset

## Class BooleanIterator

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

-     public class BooleanIterator
      extends IndexIterator

  Class to run over an iterator and visits positions where items in selection dataset are true

- - ### Field Summary

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

      `index`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BooleanIterator(IndexIterator iter, Dataset selection)` Constructor for an iterator over the items of a boolean dataset that are true
    `BooleanIterator(IndexIterator iter, Dataset selection, boolean value)` Constructor for an iterator over the items of a boolean dataset that match given value

  - ### Method Summary

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

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

      `getShape`

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

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

- - ### Constructor Detail

    - #### BooleanIterator

          public BooleanIterator(IndexIterator iter,
                         Dataset selection)

      Constructor for an iterator over the items of a boolean dataset that are true
      Parameters:
        `iter` - dataset iterator
        `selection` - boolean dataset

    - #### BooleanIterator

          public BooleanIterator(IndexIterator iter,
                         Dataset selection,
                         boolean value)

      Constructor for an iterator over the items of a boolean dataset that match given value
      Parameters:
        `iter` - dataset iterator
        `selection` - boolean dataset
        `value` -

  - ### 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`

Copyright © 2017. All rights reserved.