ConcatIterator
pprint.Util.ConcatIterator
class ConcatIterator[T](it0: Iterator[Iterator[T]], joiner: () => Iterator[T]) extends Iterator[T]
Basically a fast, efficient .flatten
or mkString
for nested iterators
For some reason, the default way of concatenation e.g.
val middle = first ++ lastChildIter ++ sep ++ remaining
Was throwing weird NullPointerExceptions I couldn't figure out =(
Also, ++ didn't seem to be sufficiently lazy, so it was forcing things earlier than it really needed to. It isn't documented anywhere how lazy it's meant to be, whereas ConcatIterator
here is obviously lazy and won't even evaluate each iterator until you ask it to
Attributes
- Graph
-
- Supertypes
-
trait Iterator[T]trait IterableOnceOps[T, Iterator, Iterator[T]]trait IterableOnce[T]class Objecttrait Matchableclass AnyShow all
Members list
Type members
Inherited classlikes
Attributes
- Inherited from:
- Iterator
- Supertypes
-
class AbstractIterator[Seq[B]]trait Iterator[Seq[B]]trait IterableOnceOps[Seq[B], Iterator, Iterator[Seq[B]]]trait IterableOnce[Seq[B]]class Objecttrait Matchableclass AnyShow all
Value members
Inherited methods
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Definition Classes
-
Iterator -> IterableOnceOps
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnce
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnce
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Definition Classes
-
Iterator -> IterableOnceOps
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Iterator -> Any
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Deprecated and Inherited methods
Attributes
- Deprecated
-
[Since version 2.13.0]
Use foldLeft instead of /: - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use foldRight instead of :\\ - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
`aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead. - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use `dest ++= coll` instead - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
hasDefiniteSize on Iterator is the same as isEmpty - Definition Classes
-
Iterator -> IterableOnceOps
- Inherited from:
- Iterator
Attributes
- Deprecated
-
[Since version 2.13.0]
Call scanRight on an Iterable instead. - Inherited from:
- Iterator
Attributes
- Deprecated
-
[Since version 2.13.0]
Iterator.seq always returns the iterator itself - Inherited from:
- Iterator
Attributes
- Deprecated
-
[Since version 2.13.0]
Use .iterator instead of .toIterator - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use .to(LazyList) instead of .toStream - Inherited from:
- IterableOnceOps
In this article