de.caff.generics

## Interface PrimitiveBooleanIterable

- All Superinterfaces:
    java.lang.Iterable<java.lang.Boolean>
  All Known Subinterfaces:
    BooleanIndexable, MutableBooleanIndexable
  All Known Implementing Classes:
    BooleanIndexable.Base, BooleanPair, MutableBooleanIndexable.Base

      public interface PrimitiveBooleanIterable
      extends java.lang.Iterable<java.lang.Boolean>

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static PrimitiveBooleanIterable` | `EMPTY` Empty iterable of primitive boolean values.
    `static PrimitiveBooleanIterator` | `EMPTY_BOOLEAN_ITERATOR` Empty iterator of primitive boolean values.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `default boolean` | `and()` Get the truth value resulting from combining all values with logical and.
    `PrimitiveBooleanIterator` | `booleanIterator()` Get a primitive boolean iterator.
    `default boolean` | `containsBool(boolean value)` Does this boolean iterable contain the given value?
    `default boolean` | `containsFalse()` Does this boolean iterable contain any `false` values?
    `default boolean` | `containsTrue()` Does this boolean iterable contain any `true` values?
    `default void` | `forEachBool(BooleanConsumer action)` Invoke the given action with each boolean value in this iterable.
    `default <E extends java.lang.Exception> void` | `forEachBooleanFragile(FragileBooleanConsumer<E> action)` Deprecated. use `forEachBoolFragile(FragileBooleanConsumer)` instead
    `default <E extends java.lang.Exception> void` | `forEachBoolFragile(FragileBooleanConsumer<E> action)` Invoke the given fragile action with each value in this iterable.
    `default java.util.Iterator<java.lang.Boolean>` | `iterator()`
    `default boolean` | `or()` Get the truth value resulting from combining all values with logical or.
    `default boolean` | `xor()` Get the truth value resulting from combining all values with logical xor.

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

      `forEach, spliterator`

- - ### Field Detail

    - #### EMPTY_BOOLEAN_ITERATOR

          static final PrimitiveBooleanIterator EMPTY_BOOLEAN_ITERATOR

      Empty iterator of primitive boolean values.
      See Also:
        `PrimitiveBooleanIterator.EMPTY`

    - #### EMPTY

          static final PrimitiveBooleanIterable EMPTY

      Empty iterable of primitive boolean values.

  - ### Method Detail

    - #### booleanIterator

          @NotNull
          PrimitiveBooleanIterator booleanIterator()

      Get a primitive boolean iterator.
      Returns:
        boolean iterator

    - #### iterator

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

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

    - #### forEachBool

          default void forEachBool(@NotNull
                                   BooleanConsumer action)

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

    - #### forEachBooleanFragile

          @Deprecated
          default <E extends java.lang.Exception> void forEachBooleanFragile(@NotNull
                                                                                         FragileBooleanConsumer<E> action)
                                                                                  throws E extends java.lang.Exception

      Deprecated. use `forEachBoolFragile(FragileBooleanConsumer)` instead
      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`

    - #### forEachBoolFragile

          default <E extends java.lang.Exception> void forEachBoolFragile(@NotNull
                                                                          FragileBooleanConsumer<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`

    - #### containsBool

          default boolean containsBool(boolean value)

      Does this boolean 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

    - #### containsTrue

          default boolean containsTrue()

      Does this boolean iterable contain any `true` values?
      Returns:
        `true` if at least one value in this iterable is `true`

    - #### containsFalse

          default boolean containsFalse()

      Does this boolean iterable contain any `false` values?
      Returns:
        `true` if at least one value in this iterable is `false`

    - #### or

          default boolean or()

      Get the truth value resulting from combining all values with logical or.
      Returns:
        `true` if this is not empty and at least one value is `true`,
        `false` otherwise

    - #### and

          default boolean and()

      Get the truth value resulting from combining all values with logical and.
      Returns:
        `true` if this is not empty and all values are `true`,
        `false` otherwise

    - #### xor

          default boolean xor()

      Get the truth value resulting from combining all values with logical xor. This assumes a start value of `false`.
      Returns:
        resulting truth from combining all values in this iterable,
        `false` if empty