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