spring-framework / org.springframework.util / CompositeIterator

CompositeIterator

open class CompositeIterator<E : Any> : MutableIterator<E>

Composite iterator that combines multiple other iterators, as registered via #add(Iterator).

This implementation maintains a linked set of iterators which are invoked in sequence until all iterators are exhausted.

Author
Erwin Vervaet

Author
Juergen Hoeller

Since
3.0

Constructors

<init>

CompositeIterator()

Composite iterator that combines multiple other iterators, as registered via #add(Iterator).

This implementation maintains a linked set of iterators which are invoked in sequence until all iterators are exhausted.

Functions

add

open fun add(iterator: MutableIterator<E>): Unit

Add given iterator to this composite.

hasNext

open fun hasNext(): Boolean

next

open fun next(): E

remove

open fun remove(): Unit