Interface CloseablePrimitiveIteratorOfShort

All Superinterfaces:
AutoCloseable, CloseableIterator<Short>, CloseablePrimitiveIterator<Short,ShortConsumer>, Iterator<Short>, PrimitiveIterator<Short,ShortConsumer>
All Known Subinterfaces:
ShortColumnIterator
All Known Implementing Classes:
ChunkedShortColumnIterator, SerialShortColumnIterator

public interface CloseablePrimitiveIteratorOfShort extends CloseablePrimitiveIterator<Short,ShortConsumer>
Closeable primitive iterator over elements of type short.
  • Field Details

  • Method Details

    • nextShort

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

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

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

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

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

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

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

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

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

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

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

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