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
.-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.PrimitiveIterator
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CloseablePrimitiveIteratorOfShort
A re-usable, immutable CloseablePrimitiveIteratorOfShort with no elements. -
Method Summary
Modifier and TypeMethodDescriptiondefault CloseablePrimitiveIteratorOfInt
adaptToOfInt
(@NotNull ShortToIntFunction adapter) Adapt this CloseablePrimitiveIteratorOfShort to aCloseablePrimitiveIteratorOfInt
, applyingadapter
to each element.concat
(@NotNull CloseablePrimitiveIteratorOfShort... subIterators) Create a CloseablePrimitiveIteratorOfShort that concatenates an array of non-null
subIterators
.empty()
Get a CloseablePrimitiveIteratorOfShort with no elements.default void
forEachRemaining
(@NotNull ShortConsumer action) default void
forEachRemaining
(@NotNull Consumer<? super Short> action) maybeConcat
(@Nullable CloseablePrimitiveIteratorOfShort first, @Nullable CloseablePrimitiveIteratorOfShort second, @Nullable CloseablePrimitiveIteratorOfShort third) Return a CloseablePrimitiveIteratorOfShort that concatenates the contents of any non-null
CloseablePrimitiveIteratorOfShort found amongstfirst
,second
, andthird
.default Short
next()
short
Returns the nextshort
element in the iteration.of
(@org.jetbrains.annotations.NotNull short... values) Create a CloseablePrimitiveIteratorOfShort over an array ofshort
.repeat
(short value, long repeatCount) Create a CloseablePrimitiveIteratorOfShort that repeatsvalue
,repeatCount
times.default IntStream
Create aIntStream
over the remaining elements of this CloseablePrimitiveIteratorOfShort by applying an implementation-defined default adapter to each element.default IntStream
streamAsInt
(@NotNull ShortToIntFunction adapter) Create aIntStream
over the remaining elements of this CloseablePrimitiveIteratorOfShort by applyingadapter
to each element.Methods inherited from interface io.deephaven.engine.primitive.iterator.CloseableIterator
close, stream
-
Field Details
-
EMPTY
A re-usable, immutable CloseablePrimitiveIteratorOfShort with no elements.
-
-
Method Details
-
nextShort
short nextShort()Returns the nextshort
element in the iteration.- Returns:
- The next
short
element in the iteration - Throws:
NoSuchElementException
- if the iteration has no more elements
-
forEachRemaining
- Specified by:
forEachRemaining
in interfacePrimitiveIterator<Short,
ShortConsumer>
-
next
-
forEachRemaining
- Specified by:
forEachRemaining
in interfaceIterator<Short>
-
adaptToOfInt
Adapt this CloseablePrimitiveIteratorOfShort to aCloseablePrimitiveIteratorOfInt
, applyingadapter
to each element. Closing the result will close this CloseablePrimitiveIteratorOfShort.- Parameters:
adapter
- The adapter to apply- Returns:
- The adapted primitive iterator
-
streamAsInt
Create aIntStream
over the remaining elements of this CloseablePrimitiveIteratorOfShort by applyingadapter
to each element. Closing the result will close this CloseablePrimitiveIteratorOfShort.- Returns:
- A
IntStream
over the remaining contents of this iterator
-
streamAsInt
Create aIntStream
over the remaining elements of this CloseablePrimitiveIteratorOfShort by applying an implementation-defined default adapter to each element. The default implementation applies a simpleint
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 beclosed
.- Returns:
- A CloseablePrimitiveIteratorOfShort with no elements
-
of
static CloseablePrimitiveIteratorOfShort of(@NotNull @org.jetbrains.annotations.NotNull short... values) Create a CloseablePrimitiveIteratorOfShort over an array ofshort
. The result does not need to beclosed
.- Parameters:
values
- The elements to iterate- Returns:
- A CloseablePrimitiveIteratorOfShort of
values
-
repeat
Create a CloseablePrimitiveIteratorOfShort that repeatsvalue
,repeatCount
times. The result does not need to beclosed
.- Parameters:
value
- The value to repeatrepeatCount
- 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 beclosed
if any of thesubIterators
require it.- Parameters:
subIterators
- The iterators to concatenate, none of which should benull
. 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 amongstfirst
,second
, andthird
.- Parameters:
first
- The first iterator to consider concatenatingsecond
- The second iterator to consider concatenatingthird
- The third iterator to consider concatenating- Returns:
- A CloseablePrimitiveIteratorOfShort that concatenates all elements as specified
-