org.apache.commons.math3.util

## Class MultidimensionalCounter.Iterator

- java.lang.Object
- - org.apache.commons.math3.util.MultidimensionalCounter.Iterator

- All Implemented Interfaces:
    Iterator<Integer>
  Enclosing class:
    MultidimensionalCounter

      public class MultidimensionalCounter.Iterator
      extends Object
      implements Iterator<Integer>

  Perform iteration over the multidimensional counter.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `count` Unidimensional counter.
    `private int[]` | `counter` Multidimensional counter.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultidimensionalCounter.Iterator()` Create an iterator

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getCount()` Get the current unidimensional counter slot.
    `int` | `getCount(int dim)` Get the current count in the selected dimension.
    `int[]` | `getCounts()` Get the current multidimensional counter slots.
    `boolean` | `hasNext()`
    `Integer` | `next()`
    `void` | `remove()`

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

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

- - ### Field Detail

    - #### counter

          private final int[] counter

      Multidimensional counter.

    - #### count

          private int count

      Unidimensional counter.

  - ### Constructor Detail

    - #### MultidimensionalCounter.Iterator

          MultidimensionalCounter.Iterator()

      Create an iterator
      See Also:
        `MultidimensionalCounter.iterator()`

  - ### Method Detail

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in interface `Iterator<Integer>`

    - #### next

          public Integer next()

      Specified by:
        `next` in interface `Iterator<Integer>`
      Returns:
        the unidimensional count after the counter has been incremented by `1`.

    - #### getCount

          public int getCount()

      Get the current unidimensional counter slot.
      Returns:
        the index within the unidimensionl counter.

    - #### getCounts

          public int[] getCounts()

      Get the current multidimensional counter slots.
      Returns:
        the indices within the multidimensional counter.

    - #### getCount

          public int getCount(int dim)

      Get the current count in the selected dimension.
      Parameters:
        `dim` - Dimension index.
      Returns:
        the count at the corresponding index for the current state of the iterator.
      Throws:
        `IndexOutOfBoundsException` - if `index` is not in the correct interval (as defined by the length of the argument in the `constructor of the enclosing class`).

    - #### remove

          public void remove()

      Specified by:
        `remove` in interface `Iterator<Integer>`
      Throws:
        `UnsupportedOperationException`

Copyright (c) 2003-2013 Apache Software Foundation