Overload constructor of Composite iterator for lazy use cases
This commit is contained in:
@@ -160,9 +160,10 @@ class FunctionIterator<T>(val nextFunction: () -> T?): AbstractIterator<T>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** An [[Iterator]] which iterates over a number of iterators in sequence */
|
/** An [[Iterator]] which iterates over a number of iterators in sequence */
|
||||||
class CompositeIterator<T>(vararg iterators: Iterator<T>): AbstractIterator<T>() {
|
fun CompositeIterator<T>(vararg iterators: Iterator<T>) = CompositeIterator(iterators.iterator())
|
||||||
|
|
||||||
|
class CompositeIterator<T>(val iterators: Iterator<Iterator<T>>): AbstractIterator<T>() {
|
||||||
|
|
||||||
val iteratorsIter = iterators.iterator()
|
|
||||||
var currentIter: Iterator<T>? = null
|
var currentIter: Iterator<T>? = null
|
||||||
|
|
||||||
override protected fun computeNext(): Unit {
|
override protected fun computeNext(): Unit {
|
||||||
|
|||||||
Reference in New Issue
Block a user