de.caff.generics

## Interface PrimitiveCharIterable

- All Superinterfaces:
    java.lang.Iterable<java.lang.Character>
  All Known Subinterfaces:
    CharIndexable, MutableCharIndexable
  All Known Implementing Classes:
    CharIndexable.Base, CharPair, MutableCharIndexable.Base

      public interface PrimitiveCharIterable
      extends java.lang.Iterable<java.lang.Character>

  Iterable which iterates over a primitive char.
  Since:
    December 13, 2021
  Author:
    Rammi
  See Also:
    `for creating one on the fly`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static PrimitiveCharIterable` | `EMPTY` Empty iterable of primitive char values.
    `static PrimitiveCharIterator` | `EMPTY_CHAR_ITERATOR` Empty iterator of primitive char values.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default PrimitiveIntIterable` | `asIntIterable()` View this byte iterable as an int iterable.
    `default PrimitiveLongIterable` | `asLongIterable()` View this byte iterable as a long iterable.
    `PrimitiveCharIterator` | `charIterator()` Get a primitive char iterator.
    `default boolean` | `containsChar(char value)` Does this char iterable contain the given value?
    `default void` | `forEachChar(CharConsumer action)` Invoke the given action with each char value in this iterable.
    `default <E extends java.lang.Exception> void` | `forEachCharFragile(FragileCharConsumer<E> action)` Invoke the given fragile action with each value in this iterable.
    `default java.util.Iterator<java.lang.Character>` | `iterator()`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### EMPTY_CHAR_ITERATOR

          static final PrimitiveCharIterator EMPTY_CHAR_ITERATOR

      Empty iterator of primitive char values.
      See Also:
        `PrimitiveCharIterator.EMPTY`

    - #### EMPTY

          static final PrimitiveCharIterable EMPTY

      Empty iterable of primitive char values.

  - ### Method Detail

    - #### charIterator

          @NotNull
          PrimitiveCharIterator charIterator()

      Get a primitive char iterator.
      Returns:
        char iterator

    - #### iterator

          @NotNull
          default java.util.Iterator<java.lang.Character> iterator()

      Specified by:
        `iterator` in interface `java.lang.Iterable<java.lang.Character>`

    - #### forEachChar

          default void forEachChar(@NotNull
                                   CharConsumer action)

      Invoke the given action with each char value in this iterable.
      Parameters:
        `action` - action to be call for each char value in sequemce.

    - #### forEachCharFragile

          default <E extends java.lang.Exception> void forEachCharFragile(@NotNull
                                                                          FragileCharConsumer<E> action)
                                                                   throws E extends java.lang.Exception

      Invoke the given fragile action with each value in this iterable.
      Type Parameters:
        `E` - checked exception thrown by action
      Parameters:
        `action` - action to be called for each value in sequence
      Throws:
        `E` - if `action` throws it
        `E extends java.lang.Exception`

    - #### containsChar

          default boolean containsChar(char value)

      Does this char iterable contain the given value? This is an operation which is linear to the size of this iterable and should only be used rarely.
      Parameters:
        `value` - value to check for
      Returns:
        `true` if the value is contained in this iterable, `false` if not

    - #### asIntIterable

          @NotNull
          default PrimitiveIntIterable asIntIterable()

      View this byte iterable as an int iterable.
      Returns:
        int iterable view of this byte iterable

    - #### asLongIterable

          @NotNull
          default PrimitiveLongIterable asLongIterable()

      View this byte iterable as a long iterable.
      Returns:
        long iterable view of this byte iterable