de.ummels.prioritymap.PriorityMapBuilder.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala-prioritymap_2.10 Show documentation
Show all versions of scala-prioritymap_2.10 Show documentation
Immutable priority maps for Scala
The newest version!
package de.ummels.prioritymap
import scala.collection.mutable
/** The canonical builder for immutable priority maps, using the `+` method
* to add new elements to an empty priority map.
*/
class PriorityMapBuilder[A, B, Coll <: PriorityMap[A, B] with PriorityMapLike[A, B, Coll]](empty: Coll)
extends mutable.MapBuilder[A, B, Coll](empty) {
override def +=(x: (A, B)): this.type = {
elems = elems + x
this
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy