AbstractIterator

abstract class AbstractIterator<T> : Iterator<T> (source)

A base class to simplify implementing iterators so that implementations only have to implement computeNext to implement the iterator, calling done when the iteration is complete.

Since Kotlin

1.1
abstract class AbstractIterator<T> : Iterator<T> (source)

A base class to simplify implementing iterators so that implementations only have to implement computeNext to implement the iterator, calling done when the iteration is complete.

Since Kotlin

1.0

Constructors

Link copied to clipboard
constructor()
constructor()

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.1

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
protected abstract fun computeNext()

Computes the next item in the iterator.

Since Kotlin 1.1
protected abstract fun computeNext()

Computes the next item in the iterator.

Since Kotlin 1.0
Link copied to clipboard
protected fun done()

Sets the state to done so that the iteration terminates.

Since Kotlin 1.1
protected fun done()

Sets the state to done so that the iteration terminates.

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.1
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
open operator override fun hasNext(): Boolean

Returns true if the iteration has more elements.

Since Kotlin 1.1
open operator override fun hasNext(): Boolean

Returns true if the iteration has more elements.

Since Kotlin 1.0
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.1
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
open operator override fun next(): T

Returns the next element in the iteration.

Since Kotlin 1.1
open operator override fun next(): T

Returns the next element in the iteration.

Since Kotlin 1.0
Link copied to clipboard
protected fun setNext(value: T)

Sets the next value in the iteration, called from the computeNext function

Since Kotlin 1.1
protected fun setNext(value: T)

Sets the next value in the iteration, called from the computeNext function

Since Kotlin 1.0
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.1

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