MutableIterator

interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

See also

Functions

Link copied to clipboard
abstract operator fun hasNext(): Boolean
abstract operator fun hasNext(): Boolean

Returns true if the iteration has more elements.

abstract operator fun hasNext(): Boolean

Returns true if the iteration has more elements.

abstract operator fun hasNext(): Boolean

Returns true if the iteration has more elements.

Link copied to clipboard
abstract operator fun next(): T
abstract operator fun next(): T

Returns the next element in the iteration.

abstract operator fun next(): T

Returns the next element in the iteration.

abstract operator fun next(): T

Returns the next element in the iteration.

Link copied to clipboard
abstract fun remove()

Removes from the underlying collection the last element returned by this iterator.

abstract fun remove()

Removes from the underlying collection the last element returned by this iterator.

abstract fun remove()

Removes from the underlying collection the last element returned by this iterator.

abstract fun remove()

Removes from the underlying collection the last element returned by this iterator.

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard

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

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

Performs the given operation on each element of this Iterator.

Link copied to clipboard
inline operator fun <T> Iterator<T>.iterator(): Iterator<T>
inline operator fun <T> Iterator<T>.iterator(): Iterator<T>
inline operator fun <T> Iterator<T>.iterator(): Iterator<T>
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.

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.