scala.collection.mutable

class LazyBuilder

[source: scala/collection/mutable/LazyBuilder.scala]

abstract class LazyBuilder[Elem, +To]
extends Builder[Elem, To]
A builder that constructs its result lazily. Iterators or iterables to be added to this builder with `++=` are not evaluated until `result` is called.
Since
2.8
Direct Known Subclasses:
Stream.StreamBuilder

Value Summary
protected var parts : ListBuffer[Traversable[Elem]]
The different segments of elements to be added to the builder, represented as iterators
Method Summary
override def ++= (xs : Iterator[Elem]) : LazyBuilder[Elem, To]
Adds a number of elements provided by an iterator to this collection.
override def ++= (xs : Traversable[Elem]) : LazyBuilder[Elem, To]
Adds a number of elements provided by an iterable object to this collection.
def += (x : Elem) : LazyBuilder[Elem, To]
Adds a single element to the builder.
def clear : Unit
Clear the contents of this builder
abstract def result : To
Returns collection resulting from this builder. The buffer's contents are undefined afterwards.
Methods inherited from Builder
sizeHint, mapResult
Methods inherited from Growable
+=
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Value Details
protected var parts : ListBuffer[Traversable[Elem]]
The different segments of elements to be added to the builder, represented as iterators

Method Details
def +=(x : Elem) : LazyBuilder[Elem, To]
Adds a single element to the builder.
Parameters
elem - The element to be added
Overrides
Builder.+=

override def ++=(xs : Iterator[Elem]) : LazyBuilder[Elem, To]
Adds a number of elements provided by an iterator to this collection.
Parameters
iter - the iterator.

override def ++=(xs : Traversable[Elem]) : LazyBuilder[Elem, To]
Adds a number of elements provided by an iterable object to this collection.
Parameters
iter - the iterable object.

abstract def result : To
Returns collection resulting from this builder. The buffer's contents are undefined afterwards.
Overrides
Builder.result

def clear : Unit
Clear the contents of this builder
Overrides
Builder.clear