MapDecorator

scala.collection.decorators.MapDecorator
class MapDecorator[C, M <: IsMap[C]](coll: C)(implicit val map: M)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

final def fullOuterJoin[W, That](other: Map[K, W])(implicit bf: BuildFrom[C, (K, (Option[V], Option[W])), That]): That

Alias for mergeByKey

Alias for mergeByKey

Attributes

final def join[W, That](other: Map[K, W])(implicit bf: BuildFrom[C, (K, (V, W)), That]): That

Alias for zipByKey

Alias for zipByKey

Attributes

def leftOuterJoin[W, That](other: Map[K, W])(implicit bf: BuildFrom[C, (K, (V, Option[W])), That]): That

Perform a left outer join of this and that.

Perform a left outer join of this and that.

Equivalent to mergeByKeyWith(that) { case (Some(v), maybeW) => (v, maybeW) }.

Attributes

That

Type of the resulting collection

W

Type of values of that

bf

Builder for the resulting collection

Returns:

A Map that associates all the keys k of this to pairs (v, Some(w)) if that associates k to w, or (v, None) if that doesn’t contain k

final def mergeByKey[W, That](other: Map[K, W])(implicit bf: BuildFrom[C, (K, (Option[V], Option[W])), That]): That

Perform a full outer join of this and that.

Perform a full outer join of this and that.

Equivalent to mergeByKeyWith(that) { case any => any }.

Attributes

That

Type of the resulting collection (e.g. Map[Int, (Option[Boolean], Option[String])])

W

Type of values of that (e.g. String)

bf

Builder for the resulting collection

Returns:

A Map that associates all the keys k of this or that to pairs (Some(v), Some(w)) if this associates k to v and that associates k to w, or pairs (None, Some(w)) if this doesn’t contain k, or pairs (Some(v), None) if that doesn’t contain k

def mergeByKeyWith[W, X, That](other: Map[K, W])(f: PartialFunction[(Option[V], Option[W]), X])(implicit bf: BuildFrom[C, (K, X), That]): That

Attributes

That

Type of the result (e.g. Map[Int, (String, Option[Boolean])])

W

Type of values of the other Map (e.g. Int, String)

X

Type of values of the resulting Map

bf

Builder driven by the type of this Map

f

Combination function

other

Map to merge

Returns:

A Map associating all the keys from this and that with values returned by the partial function f, when this one is defined.

def rightOuterJoin[W, That](other: Map[K, W])(implicit bf: BuildFrom[C, (K, (Option[V], W)), That]): That

Perform a right outer join of this and that.

Perform a right outer join of this and that.

Equivalent to mergeByKeyWith(that) { case (maybeV, Some(w)) => (maybeV, w) }.

Attributes

That

Type of the resulting collection (e.g. Map[Int, (Option[Boolean], String)])

W

Type of values of that (e.g. String)

bf

Builder for the resulting collection

Returns:

A Map that associates all the keys k of that to pairs (Some(v), w) if this associates k to v, or (None, w) if this doesn’t contain k

def zipByKey[W, That](other: Map[K, W])(implicit bf: BuildFrom[C, (K, (V, W)), That]): That

Combines the entries of this Map with the entries of that Map that have the same key, tupling their values. xs.zipByKey(ys) is a shorthand for xs.zipByKeyWith(ys)((_, _)).

Combines the entries of this Map with the entries of that Map that have the same key, tupling their values. xs.zipByKey(ys) is a shorthand for xs.zipByKeyWith(ys)((_, _)).

Attributes

That

Type of the result (e.g. Map[Int, (String, Boolean)], TreeMap[String, (Int, Int)])

W

Type of values of the other Map (e.g. Int, String)

bf

Builder driven by the type of this Map

other

Other Map

Returns:

A Map that associates all the keys k contained by both this and that to pairs (v, w) where v is the value associated by this to k and w the value associated by that to k

def zipByKeyWith[W, X, That](other: Map[K, W])(f: (V, W) => X)(implicit bf: BuildFrom[C, (K, X), That]): That

Combines entries of this Map with entries of that Map that have the same key, using the combination function f

Combines entries of this Map with entries of that Map that have the same key, using the combination function f

Attributes

That

Type of the resulting Map

W

Type of values of the other Map (e.g. Int, String)

X

Type of values of the resulting Map

bf

Builder driven by the type of this Map

f

Combination function

other

Other Map

Returns:

A Map that associates all the keys k contained by both this and that to the result of the application of f to the values v and w respectively associated by this and that to k

Implicits

Implicits

implicit val map: M