CodePointIndexedIterator
An iterator for traversing Unicode code points bidirectionally within a text.
This interface extends the capabilities of CodePointIterator by adding support for reverse iteration and positional control.
Functionalities provided by this iterator include:
Determining if there are more code points to iterate in either forward or reverse direction: hasNext, hasPrevious.
Determining the char position of the next or previous code point: nextIndex, previousIndex.
Retrieving the next or previous code point using next and previous functions.
Advancing the iteration by a specified number of code points in either direction: advanceByCodePoints.
The iterator can be obtained from a String, CharSequence, or CharArray using the codePointIterator function.
Since Kotlin
2.5Functions
Advances the iterator by the specified number of Unicode code points, either forward or backward.
Returns true if the iterator can return more code points when iterating in reverse direction.
Returns the char-based position of the previous Unicode code point in the iteration that would be returned by a subsequent call to previous, or -1 if the iteration has reached the beginning.
Returns an Iterator that wraps each element produced by the original iterator into an IndexedValue containing the index of that element and the element itself.