de.caff.generics

## Interface PrimitiveFloatIterator

- All Superinterfaces:
    java.util.Iterator<java.lang.Float>, java.util.PrimitiveIterator<java.lang.Float,FloatConsumer>

      public interface PrimitiveFloatIterator
      extends java.util.PrimitiveIterator<java.lang.Float,FloatConsumer>

  An iterator specialized for `float` values.

  This is missing in the standard library: an iterator for raw `float` values which does everything what `OfInt` does for [@code int}s.

  Since:
    September 27, 2020
  Author:
    Rammi

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface java.util.PrimitiveIterator

      `java.util.PrimitiveIterator.OfDouble, java.util.PrimitiveIterator.OfInt, java.util.PrimitiveIterator.OfLong`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static PrimitiveFloatIterator` | `EMPTY` Empty iterator of primitive float values.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default java.util.PrimitiveIterator.OfDouble` | `asDoubleIterator()` View this float iterator as a double iterator.
    `default void` | `forEachRemaining(java.util.function.Consumer<? super java.lang.Float> action)` If the action is an instance of `FloatConsumer` then it is cast to `FloatConsumer` and passed to `forEachRemaining(de.caff.generics.function.FloatConsumer)`; otherwise the action is adapted to an instance of `FloatConsumer`, by boxing the argument of `FloatConsumer`, and then passed to `forEachRemaining(de.caff.generics.function.FloatConsumer)`.
    `default void` | `forEachRemaining(FloatConsumer action)` Performs the given action for each remaining element until all elements have been processed or the action throws an exception.
    `default java.lang.Float` | `next()` The default implementation boxes the result of calling `nextFloat()`, and returns that boxed result.
    `float` | `nextFloat()` Returns the next `float` element in the iteration.

    - ### Methods inherited from interface java.util.Iterator

      `hasNext, remove`

- - ### Field Detail

    - #### EMPTY

          static final PrimitiveFloatIterator EMPTY

      Empty iterator of primitive float values.

  - ### Method Detail

    - #### nextFloat

          float nextFloat()

      Returns the next `float` element in the iteration.
      Returns:
        the next `float` element in the iteration
      Throws:
        `java.util.NoSuchElementException` - if the iteration has no more elements

    - #### forEachRemaining

          default void forEachRemaining(@NotNull
                                        FloatConsumer action)

      Performs the given action for each remaining element until all elements have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.

      The default implementation behaves as if:

               while (hasNext())
                   action.accept(nextFloat());

      Specified by:
        `forEachRemaining` in interface `java.util.PrimitiveIterator<java.lang.Float,FloatConsumer>`
      Parameters:
        `action` - The action to be performed for each element
      Throws:
        `java.lang.NullPointerException` - if the specified action is null

    - #### next

          default java.lang.Float next()

      The default implementation boxes the result of calling `nextFloat()`, and returns that boxed result.
      Specified by:
        `next` in interface `java.util.Iterator<java.lang.Float>`

    - #### forEachRemaining

          default void forEachRemaining(@NotNull
                                        java.util.function.Consumer<? super java.lang.Float> action)

      If the action is an instance of `FloatConsumer` then it is cast to `FloatConsumer` and passed to `forEachRemaining(de.caff.generics.function.FloatConsumer)`; otherwise the action is adapted to an instance of `FloatConsumer`, by boxing the argument of `FloatConsumer`, and then passed to `forEachRemaining(de.caff.generics.function.FloatConsumer)`.
      Specified by:
        `forEachRemaining` in interface `java.util.Iterator<java.lang.Float>`

    - #### asDoubleIterator

          @NotNull
          default java.util.PrimitiveIterator.OfDouble asDoubleIterator()

      View this float iterator as a double iterator. Please note that you should use either this iterator of the returned one, but don't mix using both.
      Returns:
        a view of this iterator as a double iterator