Interface CloseablePrimitiveIteratorOfByte

All Superinterfaces:
AutoCloseable, CloseableIterator<Byte>, CloseablePrimitiveIterator<Byte,ByteConsumer>, Iterator<Byte>, PrimitiveIterator<Byte,ByteConsumer>, SafeCloseable
All Known Subinterfaces:
ByteColumnIterator
All Known Implementing Classes:
ChunkedByteColumnIterator, SerialByteColumnIterator

public interface CloseablePrimitiveIteratorOfByte extends CloseablePrimitiveIterator<Byte,ByteConsumer>
Closeable primitive iterator over elements of type byte.
  • Field Details

  • Method Details

    • nextByte

      byte nextByte()
      Returns the next byte element in the iteration.
      Returns:
      The next byte element in the iteration
      Throws:
      NoSuchElementException - if the iteration has no more elements
    • forEachRemaining

      default void forEachRemaining(@NotNull @NotNull ByteConsumer action)
      Specified by:
      forEachRemaining in interface PrimitiveIterator<Byte,ByteConsumer>
    • next

      default Byte next()
      Specified by:
      next in interface Iterator<Byte>
    • forEachRemaining

      default void forEachRemaining(@NotNull @NotNull Consumer<? super Byte> action)
      Specified by:
      forEachRemaining in interface Iterator<Byte>
    • adaptToOfInt

      default CloseablePrimitiveIteratorOfInt adaptToOfInt(@NotNull @NotNull ByteToIntFunction adapter)
      Adapt this CloseablePrimitiveIteratorOfByte to a CloseablePrimitiveIteratorOfInt, applying adapter to each element. Closing the result will close this CloseablePrimitiveIteratorOfByte.
      Parameters:
      adapter - The adapter to apply
      Returns:
      The adapted primitive iterator
    • streamAsInt

      default IntStream streamAsInt(@NotNull @NotNull ByteToIntFunction adapter)
      Create a IntStream over the remaining elements of this CloseablePrimitiveIteratorOfByte by applying adapter to each element. Closing the result will close this CloseablePrimitiveIteratorOfByte.
      Returns:
      A IntStream over the remaining contents of this iterator
    • streamAsInt

      default IntStream streamAsInt()
      Create a IntStream over the remaining elements of this CloseablePrimitiveIteratorOfByte by applying an implementation-defined default adapter to each element. The default implementation applies a simple int cast. Closing the result will close this CloseablePrimitiveIteratorOfByte.
      Returns:
      A IntStream over the remaining contents of this iterator
    • empty

      Get a CloseablePrimitiveIteratorOfByte with no elements. The result does not need to be closed.
      Returns:
      A CloseablePrimitiveIteratorOfByte with no elements
    • of

      static CloseablePrimitiveIteratorOfByte of(@NotNull @org.jetbrains.annotations.NotNull byte... values)
      Create a CloseablePrimitiveIteratorOfByte over an array of byte. The result does not need to be closed.
      Parameters:
      values - The elements to iterate
      Returns:
      A CloseablePrimitiveIteratorOfByte of values
    • repeat

      static CloseablePrimitiveIteratorOfByte repeat(byte value, long repeatCount)
      Create a CloseablePrimitiveIteratorOfByte that repeats value, repeatCount times. The result does not need to be closed.
      Parameters:
      value - The value to repeat
      repeatCount - The number of repetitions
      Returns:
      A CloseablePrimitiveIteratorOfByte that repeats value, repeatCount times
    • concat

      static CloseablePrimitiveIteratorOfByte concat(@NotNull @NotNull CloseablePrimitiveIteratorOfByte... subIterators)
      Create a CloseablePrimitiveIteratorOfByte that concatenates an array of non-null subIterators. The result only needs to be closed if any of the subIterators require it.
      Parameters:
      subIterators - The iterators to concatenate, none of which should be null. If directly passing an array, ensure that this iterator has full ownership.
      Returns:
      A CloseablePrimitiveIteratorOfByte concatenating all elements from subIterators
    • maybeConcat

      static CloseablePrimitiveIteratorOfByte maybeConcat(@Nullable @Nullable CloseablePrimitiveIteratorOfByte first, @Nullable @Nullable CloseablePrimitiveIteratorOfByte second, @Nullable @Nullable CloseablePrimitiveIteratorOfByte third)
      Return a CloseablePrimitiveIteratorOfByte that concatenates the contents of any non-null CloseablePrimitiveIteratorOfByte found amongst first, second, and third.
      Parameters:
      first - The first iterator to consider concatenating
      second - The second iterator to consider concatenating
      third - The third iterator to consider concatenating
      Returns:
      A CloseablePrimitiveIteratorOfByte that concatenates all elements as specified