Interface CloseablePrimitiveIteratorOfChar
- All Superinterfaces:
AutoCloseable,CloseableIterator<Character>,CloseablePrimitiveIterator<Character,,CharConsumer> Iterator<Character>,PrimitiveIterator<Character,CharConsumer>
- All Known Subinterfaces:
CharacterColumnIterator,ValueIteratorOfChar
- 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
FieldsModifier and TypeFieldDescriptionstatic final CloseablePrimitiveIteratorOfCharA re-usable, immutable CloseablePrimitiveIteratorOfChar with no elements. -
Method Summary
Modifier and TypeMethodDescriptiondefault CloseablePrimitiveIteratorOfIntadaptToOfInt(@NotNull CharToIntFunction adapter) Adapt this CloseablePrimitiveIteratorOfChar to aCloseablePrimitiveIteratorOfInt, applyingadapterto each element.concat(@NotNull CloseablePrimitiveIteratorOfChar... subIterators) Create a CloseablePrimitiveIteratorOfChar that concatenates an array of non-nullsubIterators.empty()Get a CloseablePrimitiveIteratorOfChar with no elements.default voidforEachRemaining(@NotNull CharConsumer action) default voidforEachRemaining(@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-nullCloseablePrimitiveIteratorOfChar found amongstfirst,second, andthird.default Characternext()charnextChar()Returns the nextcharelement 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,repeatCounttimes.default IntStreamCreate aIntStreamover the remaining elements of this CloseablePrimitiveIteratorOfChar by applying an implementation-defined default adapter to each element.default IntStreamstreamAsInt(@NotNull CharToIntFunction adapter) Create aIntStreamover the remaining elements of this CloseablePrimitiveIteratorOfChar by applyingadapterto 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 nextcharelement in the iteration.- Returns:
- The next
charelement in the iteration - Throws:
NoSuchElementException- if the iteration has no more elements
-
forEachRemaining
- Specified by:
forEachRemainingin interfacePrimitiveIterator<Character,CharConsumer>
-
next
-
forEachRemaining
- Specified by:
forEachRemainingin interfaceIterator<Character>
-
adaptToOfInt
Adapt this CloseablePrimitiveIteratorOfChar to aCloseablePrimitiveIteratorOfInt, applyingadapterto each element. Closing the result will close this CloseablePrimitiveIteratorOfChar.- Parameters:
adapter- The adapter to apply- Returns:
- The adapted primitive iterator
-
streamAsInt
Create aIntStreamover the remaining elements of this CloseablePrimitiveIteratorOfChar by applyingadapterto each element. Closing the result will close this CloseablePrimitiveIteratorOfChar.- Returns:
- A
IntStreamover the remaining contents of this iterator
-
streamAsInt
Create aIntStreamover the remaining elements of this CloseablePrimitiveIteratorOfChar by applying an implementation-defined default adapter to each element. The default implementation applies a simpleintcast. Closing the result will close this CloseablePrimitiveIteratorOfChar.- Returns:
- A
IntStreamover 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,repeatCounttimes. The result does not need to beclosed.- Parameters:
value- The value to repeatrepeatCount- The number of repetitions- Returns:
- A CloseablePrimitiveIteratorOfChar that repeats
value,repeatCounttimes
-
concat
static CloseablePrimitiveIteratorOfChar concat(@NotNull @NotNull CloseablePrimitiveIteratorOfChar... subIterators) Create a CloseablePrimitiveIteratorOfChar that concatenates an array of non-nullsubIterators. The result only needs to beclosedif any of thesubIteratorsrequire 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-nullCloseablePrimitiveIteratorOfChar 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
-