com.timgroup.iterata
An iterator which memoizes the first call to hasNext which returns false.
hasNext
This is useful when the wrapped iterator needs to do I/O in hasNext, preventing further expensive calls. It is also a suitable workaround for SI-9623.
See: https://issues.scala-lang.org/browse/SI-9623
scala> import com.timgroup.iterata.MemoizeExhaustionIterator.Implicits._ scala> val it1 = new IteratorWithExpensiveHasNext() scala> val it2 = new IteratorWithExpensiveHasNext() scala> (it1.memoizeExhaustion ++ it2).foreach(_ => ()) scala> it1.numTimesHasNextReturnedFalse res2: Int = 1
the type of each element
an underlying iterator for which to memoize the first false result from hasNext
(Changed in version 2.8.0) collect has changed. The previous behavior can be reproduced with toSeq.
collect
toSeq
An iterator which memoizes the first call to
hasNext
which returns false.This is useful when the wrapped iterator needs to do I/O in hasNext, preventing further expensive calls. It is also a suitable workaround for SI-9623.
See: https://issues.scala-lang.org/browse/SI-9623
the type of each element