org.eclipse.january.dataset

## Class BooleanIterator

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

- Direct Known Subclasses:
    BooleanBroadcastIterator, BooleanContiguousIterator, BooleanNullIterator

      public abstract class BooleanIterator
      extends IndexIterator

  Base class for boolean iterators for pairs of dataset where the second dataset could be broadcast to the first and is used to select where {`IndexIterator.hasNext()` returns true. An optional third dataset can specify the output. For speed, there are public members.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Dataset` | `aDataset`
    `protected int` | `aMax`
    `protected int` | `aStart`
    `protected int` | `aStep`
    `protected Dataset` | `cDataset`
    `int` | `cIndex` Index in choice dataset
    `protected int[]` | `maxShape`
    `protected Dataset` | `oDataset` Output dataset
    `int` | `oIndex` Index in output dataset
    `protected int` | `oStart`
    `protected int` | `oStep`
    `protected boolean` | `outputA`
    `protected boolean` | `value`

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

      `index`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BooleanIterator(boolean v, Dataset a, Dataset c, Dataset o)` Construct a boolean iterator that stops at the given boolean value in choice dataset

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static BooleanIterator` | `createIterator(boolean v, Dataset a, Dataset c, Dataset o)` Create a boolean iterator that stops at every position in the choice dataset where its value matches the given boolean
    `static BooleanIterator` | `createIterator(boolean v, Dataset a, Dataset c, Dataset o, boolean createIfNull)` Create a boolean iterator that stops at every position in the choice dataset where its value matches the given boolean
    `static BooleanIterator` | `createIterator(Dataset a, Dataset c)` Create a boolean iterator that stops at every position in the choice dataset with a true value
    `static BooleanIterator` | `createIterator(Dataset a, Dataset c, Dataset o)` Create a boolean iterator that stops at every position in the choice dataset with a true value
    `Dataset` | `getChoice()`
    `Dataset` | `getOutput()`
    `int[]` | `getShape()`

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

      `getPos, hasNext, reset`

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

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

- - ### Field Detail

    - #### value

          protected final boolean value

    - #### cIndex

          public int cIndex

      Index in choice dataset

    - #### oIndex

          public int oIndex

      Index in output dataset

    - #### oDataset

          protected Dataset oDataset

      Output dataset

    - #### outputA

          protected final boolean outputA

    - #### maxShape

          protected int[] maxShape

    - #### aStep

          protected final int aStep

    - #### oStep

          protected int oStep

    - #### aMax

          protected int aMax

    - #### aStart

          protected int aStart

    - #### oStart

          protected int oStart

    - #### aDataset

          protected Dataset aDataset

    - #### cDataset

          protected Dataset cDataset

  - ### Constructor Detail

    - #### BooleanIterator

          protected BooleanIterator(boolean v,
                                    Dataset a,
                                    Dataset c,
                                    Dataset o)

      Construct a boolean iterator that stops at the given boolean value in choice dataset
      Parameters:
        `v` - boolean value
        `a` - primary dataset
        `c` - choice dataset
        `o` - output dataset, can be null

  - ### Method Detail

    - #### createIterator

          public static BooleanIterator createIterator(Dataset a,
                                                       Dataset c)

      Create a boolean iterator that stops at every position in the choice dataset with a true value
      Parameters:
        `a` - primary dataset
        `c` - choice dataset, can be null to choose all
      Returns:
        boolean iterator
      Since:
        2.1

    - #### createIterator

          public static BooleanIterator createIterator(Dataset a,
                                                       Dataset c,
                                                       Dataset o)

      Create a boolean iterator that stops at every position in the choice dataset with a true value
      Parameters:
        `a` - primary dataset
        `c` - choice dataset, can be null to choose all
        `o` - output dataset, can be null
      Returns:
        boolean iterator
      Since:
        2.1

    - #### createIterator

          public static BooleanIterator createIterator(boolean v,
                                                       Dataset a,
                                                       Dataset c,
                                                       Dataset o)

      Create a boolean iterator that stops at every position in the choice dataset where its value matches the given boolean
      Parameters:
        `v` - boolean value
        `a` - primary dataset
        `c` - choice dataset, can be null to choose all
        `o` - output dataset, can be null
      Returns:
        boolean iterator
      Since:
        2.1

    - #### createIterator

          public static BooleanIterator createIterator(boolean v,
                                                       Dataset a,
                                                       Dataset c,
                                                       Dataset o,
                                                       boolean createIfNull)

      Create a boolean iterator that stops at every position in the choice dataset where its value matches the given boolean
      Parameters:
        `v` - boolean value
        `a` - primary dataset
        `c` - choice dataset, can be null to choose all
        `o` - output dataset, can be null
        `createIfNull` - if true create the output dataset if that is null
      Returns:
        boolean iterator
      Since:
        2.1

    - #### getChoice

          public Dataset getChoice()

      Returns:
        choice
      Since:
        2.1

    - #### getShape

          public int[] getShape()

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

    - #### getOutput

          public Dataset getOutput()

      Returns:
        output dataset (can be null)
      Since:
        2.1

Copyright © 2014–2022 Eclipse Foundation. All rights reserved.