org.eclipse.january.dataset

## Class BroadcastIteratorBase

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

- Direct Known Subclasses:
    BroadcastIterator, BroadcastSelfIterator

      public abstract class BroadcastIteratorBase
      extends IndexIterator

  Base class for all broadcast iterators. For speed, there are public members. Note, index is not updated

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Dataset` | `aDataset`
    `int` | `aIndex` Index in first dataset
    `protected boolean` | `asDouble`
    `protected Dataset` | `bDataset`
    `double` | `bDouble` Current value in second dataset
    `int` | `bIndex` Index in second dataset
    `long` | `bLong` Current value in second dataset
    `protected int[]` | `maxShape`
    `protected int[]` | `pos` position in dataset
    `protected boolean` | `read`

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

      `index`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BroadcastIteratorBase(Dataset a, Dataset b)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int[]` | `getPos()`
    `int[]` | `getShape()`
    `boolean` | `isOutputDouble()`
    `void` | `setOutputDouble(boolean asDouble)` Set to output doubles
    `protected abstract void` | `storeCurrentValues()` Read and store current values

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

      `hasNext, reset`

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

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

- - ### Field Detail

    - #### aIndex

          public int aIndex

      Index in first dataset

    - #### bIndex

          public int bIndex

      Index in second dataset

    - #### bDouble

          public double bDouble

      Current value in second dataset

    - #### bLong

          public long bLong

      Current value in second dataset

    - #### asDouble

          protected boolean asDouble

    - #### read

          protected boolean read

    - #### maxShape

          protected int[] maxShape

    - #### pos

          protected int[] pos

      position in dataset

    - #### aDataset

          protected Dataset aDataset

    - #### bDataset

          protected Dataset bDataset

  - ### Constructor Detail

    - #### BroadcastIteratorBase

          public BroadcastIteratorBase(Dataset a,
                               Dataset b)

  - ### Method Detail

    - #### getShape

          public int[] getShape()

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

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

    - #### isOutputDouble

          public boolean isOutputDouble()

      Returns:
        true if output from iterator is double

    - #### setOutputDouble

          public void setOutputDouble(boolean asDouble)

      Set to output doubles
      Parameters:
        `asDouble` -

    - #### storeCurrentValues

          protected abstract void storeCurrentValues()

      Read and store current values

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