Interface CloseablePrimitiveIteratorOfChar

All Superinterfaces:
AutoCloseable, CloseableIterator<Character>, CloseablePrimitiveIterator<Character,CharConsumer>, Iterator<Character>, PrimitiveIterator<Character,CharConsumer>
All Known Subinterfaces:
CharacterColumnIterator
All Known Implementing Classes:
ChunkedCharacterColumnIterator, SerialCharacterColumnIterator

public interface CloseablePrimitiveIteratorOfChar extends CloseablePrimitiveIterator<Character,CharConsumer>
Closeable primitive iterator over elements of type char.
  • Field Details

  • Method Details

    • nextChar

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

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

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

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

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

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

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

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

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

      static CloseablePrimitiveIteratorOfChar repeat(char value, long repeatCount)
      Create a CloseablePrimitiveIteratorOfChar 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 CloseablePrimitiveIteratorOfChar that repeats value, repeatCount times
    • concat

      static CloseablePrimitiveIteratorOfChar concat(@NotNull @NotNull CloseablePrimitiveIteratorOfChar... subIterators)
      Create a CloseablePrimitiveIteratorOfChar 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 CloseablePrimitiveIteratorOfChar concatenating all elements from subIterators
    • maybeConcat

      static CloseablePrimitiveIteratorOfChar maybeConcat(@Nullable @Nullable CloseablePrimitiveIteratorOfChar first, @Nullable @Nullable CloseablePrimitiveIteratorOfChar second, @Nullable @Nullable CloseablePrimitiveIteratorOfChar third)
      Return a CloseablePrimitiveIteratorOfChar that concatenates the contents of any non-null CloseablePrimitiveIteratorOfChar 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 CloseablePrimitiveIteratorOfChar that concatenates all elements as specified