scala.collection.mutable

MapBuilder

class MapBuilder[A, B, Coll <: Map[A, B] with MapLike[A, B, Coll]] extends Builder[(A, B), Coll]

The canonical builder for immutable maps, working with the map's + method to add new elements. Collections are built from their empty element using this + method.

Inherits

  1. Builder
  2. Growable
  3. AnyRef
  4. Any

Value Members

  1. def ++=(elems: Traversable[(A, B)]): Growable[(A, B)]

    adds all elements contained in a traversable collection to this growable collection

  2. def ++=(iter: Iterator[(A, B)]): Growable[(A, B)]

    adds all elements produced by an iterator to this growable collection

  3. def +=(x: (A, B)): MapBuilder[A, B, Coll]

    Adds a single element to the builder

  4. def +=(elem1: (A, B), elem2: (A, B), elems: (A, B)*): Growable[(A, B)]

    adds two or more elements to this growable collection

  5. def clear(): Unit

    Clears the contents of this builder

  6. def equals(arg0: Any): Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence

  7. def hashCode(): Int

    Returns a hash code value for the object

  8. def mapResult[NewTo](f: (Coll) ⇒ NewTo): Builder[(A, B), NewTo]

    Creates a new builder by applying a transformation function to the results of this builder

  9. def result(): Coll

    Produces a collection from the added elements

  10. def sizeHint(size: Int): Unit

    Gives a hint how many elements are expected to be added when the next result is called

  11. def toString(): String

    Returns a string representation of the object

Instance constructors

  1. new MapBuilder(empty: Coll)

  2. new MapBuilder()