de.caff.generics

## Interface PrimitiveByteIterable

- All Superinterfaces:
    java.lang.Iterable<java.lang.Byte>
  All Known Subinterfaces:
    ByteIndexable, MutableByteIndexable
  All Known Implementing Classes:
    ByteIndexable.Base, BytePair, MutableByteIndexable.Base

      public interface PrimitiveByteIterable
      extends java.lang.Iterable<java.lang.Byte>

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static PrimitiveByteIterable` | `EMPTY` Empty iterable of primitive byte values.
    `static PrimitiveByteIterator` | `EMPTY_BYTE_ITERATOR` Empty iterator of primitive byte 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.
    `default PrimitiveShortIterable` | `asShortIterable()` View this byte iterable as a short iterable.
    `default PrimitiveIntIterable` | `asUnsignedIntIterable()` View this byte iterable as an int iterable which uses the unsigned byte values of this iterable.
    `default PrimitiveLongIterable` | `asUnsignedLongIterable()` View this byte iterable as a long iterable which uses the unsigned byte values of this iterable.
    `PrimitiveByteIterator` | `byteIterator()` Get a primitive byte iterator.
    `default boolean` | `containsByte(byte value)` Does this byte iterable contain the given value?
    `default void` | `forEachByte(ByteConsumer action)` Invoke the given action with each byte value in this iterable.
    `default <E extends java.lang.Exception> void` | `forEachByteFragile(FragileByteConsumer<E> action)` Invoke the given fragile action with each value in this iterable.
    `default java.util.Iterator<java.lang.Byte>` | `iterator()`

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

      `forEach, spliterator`

- - ### Field Detail

    - #### EMPTY_BYTE_ITERATOR

          static final PrimitiveByteIterator EMPTY_BYTE_ITERATOR

      Empty iterator of primitive byte values.
      See Also:
        `PrimitiveByteIterator.EMPTY`

    - #### EMPTY

          static final PrimitiveByteIterable EMPTY

      Empty iterable of primitive byte values.

  - ### Method Detail

    - #### byteIterator

          @NotNull
          PrimitiveByteIterator byteIterator()

      Get a primitive byte iterator.
      Returns:
        byte iterator

    - #### iterator

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

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

    - #### forEachByte

          default void forEachByte(@NotNull
                                   ByteConsumer action)

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

    - #### forEachByteFragile

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

    - #### containsByte

          default boolean containsByte(byte value)

      Does this byte iterable contain the given value? This is an operation which takes time 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

    - #### asShortIterable

          @NotNull
          default PrimitiveShortIterable asShortIterable()

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

    - #### asIntIterable

          @NotNull
          default PrimitiveIntIterable asIntIterable()

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

    - #### asUnsignedIntIterable

          @NotNull
          default PrimitiveIntIterable asUnsignedIntIterable()

      View this byte iterable as an int iterable which uses the unsigned byte values of this iterable.
      Returns:
        unsigned 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

    - #### asUnsignedLongIterable

          @NotNull
          default PrimitiveLongIterable asUnsignedLongIterable()

      View this byte iterable as a long iterable which uses the unsigned byte values of this iterable.
      Returns:
        unsigned long iterable view of this byte iterable