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