Iterator

expect interface Iterator<out T>(source)

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

Since Kotlin

1.0

Inheritors

actual interface Iterator<out T>(source)

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

Since Kotlin

1.1

Inheritors

actual interface Iterator<out T>(source)

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

Since Kotlin

1.0

Inheritors

actual interface Iterator<out T>(source)

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

Since Kotlin

1.3

Inheritors

actual interface Iterator<out T>(source)

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

Since Kotlin

1.8

Inheritors

actual interface Iterator<out T>(source)

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

Since Kotlin

1.8

Inheritors

Functions

Link copied to clipboard

Creates a sequence that returns all elements from this iterator. The sequence is constrained to be iterated only once.

Since Kotlin 1.0
Link copied to clipboard
inline fun <T> Iterator<T>.forEach(operation: (T) -> Unit)

Performs the given operation on each element of this Iterator.

Since Kotlin 1.0
Link copied to clipboard
expect abstract operator fun hasNext(): Boolean

Returns true if the iteration has more elements.

Since Kotlin 1.0
actual abstract operator fun hasNext(): Boolean

Returns true if the iteration has more elements.

Since Kotlin 1.1
actual abstract operator fun hasNext(): Boolean

Returns true if the iteration has more elements.

Since Kotlin 1.0
actual abstract operator fun hasNext(): Boolean

Returns true if the iteration has more elements.

Since Kotlin 1.3
actual abstract operator fun hasNext(): Boolean

Returns true if the iteration has more elements.

Since Kotlin 1.8
actual abstract operator fun hasNext(): Boolean

Returns true if the iteration has more elements.

Since Kotlin 1.8
Link copied to clipboard
inline operator fun <T> Iterator<T>.iterator(): Iterator<T>

Returns the given iterator itself. This allows to use an instance of iterator in a for loop.

Since Kotlin 1.0
Link copied to clipboard
expect abstract operator fun next(): T

Returns the next element in the iteration.

Since Kotlin 1.0
actual abstract operator fun next(): T

Returns the next element in the iteration.

Since Kotlin 1.1
actual abstract operator fun next(): T

Returns the next element in the iteration.

Since Kotlin 1.0
actual abstract operator fun next(): T

Returns the next element in the iteration.

Since Kotlin 1.3
actual abstract operator fun next(): T

Returns the next element in the iteration.

Since Kotlin 1.8
actual abstract operator fun next(): T

Returns the next element in the iteration.

Since Kotlin 1.8
Link copied to clipboard

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.

Since Kotlin 1.0