scala.collection.mutable

class AddingBuilder

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

class AddingBuilder[A, Coll <: Addable[A, Coll] with Iterable[A] with IterableLike[A, Coll]](empty : Coll)
extends Builder[A, Coll]
The canonical builder for collections that are addable, i.e. that support an efficient + method which adds an element to the collection. Collections are built from their empty element using this + method.
Parameters
empty - The empty element of the collection.
Since
2.8
Value Summary
protected var elems : Coll
Method Summary
def += (x : A) : AddingBuilder[A, Coll]
Adds a single element to the builder.
def clear : Unit
Clear the contents of this builder
def result : Coll
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 elems : Coll

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

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

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