scala.collection.immutable

trait Map

[source: scala/collection/immutable/Map.scala]

trait Map[A, +B]
extends Iterable[(A, B)] with Map[A, B] with MapLike[A, B, Map[A, B]]
Since
1
Direct Known Subclasses:
HashMap, IntMap, ListMap, LongMap, Map.WithDefault, Map.EmptyMap, Map.Map1, Map.Map2, Map.Map3, Map.Map4, MapProxy, SortedMap

Method Summary
abstract def + [B1 >: B](kv : (A, B1)) : Map[A, B1]
Add a key/value pair to this map, returning a new map.
override def empty : Map[A, B]
override abstract def updated [B1 >: B](key : A, value : B1) : Map[A, B1]
Add a key/value pair to this map.
def withDefault [B1 >: B](d : (A) => B1) : Map[A, B1]
The same map with a given default function !!! todo: move to general maps?
def withDefaultValue [B1 >: B](d : B1) : Map[A, B1]
The same map with a given default value
Methods inherited from MapLike
+, ++, ++, transform, filterNot, update
Methods inherited from MapLike
get (abstract), iterator (abstract), - (abstract), newBuilder, isEmpty, getOrElse, apply, contains, isDefinedAt, keySet, keysIterator, keys, valuesIterable, valuesIterator, values, default, filterKeys, mapValues, mapElements, addString, stringPrefix, toString, hashCode, equals
Methods inherited from Subtractable
-, --, --
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from Iterable
companion
Methods inherited from IterableLike
thisCollection, toCollection, elements, foreach, forall, exists, find, foldRight, reduceRight, toIterable, head, take, slice, takeWhile, takeRight, dropRight, copyToArray, zip, zipAll, zipWithIndex, sameElements, toStream, canEqual, view, view, first, firstOption, projection
Methods inherited from GenericTraversableTemplate
genericBuilder, unzip, flatten, transpose
Methods inherited from TraversableLike
repr, nonEmpty, size, hasDefiniteSize, ++, ++, map, flatMap, filter, partialMap, remove, partition, groupBy, count, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, tail, last, lastOption, init, drop, dropWhile, span, splitAt, copyToBuffer, copyToArray, toArray, toList, toSeq, toIndexedSeq, toSet, mkString, mkString, mkString, addString, addString, withFilter
Methods inherited from AnyRef
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
override def empty : Map[A, B]
Overrides
Map.empty

override abstract def updated[B1 >: B](key : A, value : B1) : Map[A, B1]
Add a key/value pair to this map.
Parameters
key - the key
value - the value
Returns
A new map with the new binding added to this map
Overrides
MapLike.updated

abstract def +[B1 >: B](kv : (A, B1)) : Map[A, B1]
Add a key/value pair to this map, returning a new map.
Parameters
kv - the key/value pair
Returns
A new map with the new binding added to this map
Overrides
MapLike.+

def withDefault[B1 >: B](d : (A) => B1) : Map[A, B1]
The same map with a given default function !!! todo: move to general maps?

def withDefaultValue[B1 >: B](d : B1) : Map[A, B1]
The same map with a given default value