scala.collection.immutable

trait SortedMap

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

trait SortedMap[A, +B]
extends Map[A, B] with SortedMap[A, B]
Direct Known Subclasses:
TreeMap

Method Summary
override def + [B1 >: B](kv : (A, B1)) : SortedMap[A, B1]
Add a key/value pair to this map.
override def + [B1 >: B](kv1 : (A, B1), kv2 : (A, B1), kvs : (A, B1)*) : SortedMap[A, B1]
Add two or more key/value pairs to this map.
override def ++ [B1 >: B](kvs : Iterator[(A, B1)]) : SortedMap[A, B1]
Add a sequence of key/value pairs to this map.
override def ++ [B1 >: B](kvs : Iterable[(A, B1)]) : SortedMap[A, B1]
Add a sequence of key/value pairs to this map.
override def - (key1 : A, key2 : A, keys : A*) : SortedMap[A, B]
Remove two or more keys from this map
override abstract def - (key : A) : SortedMap[A, B]
Remove a key from this map
override def -- (keys : Iterator[A]) : SortedMap[A, B]
Remove a sequence of keys from this map
override def -- (keys : Iterable[A]) : SortedMap[A, B]
Remove a sequence of keys from this map
override abstract def empty [C] : SortedMap[A, C]
This method returns a new map instance of the same class mapping keys of the same type to values of type C.
override def filter (p : ((A, B)) => Boolean) : SortedMap[A, B]
This method removes all the mappings for which the predicate p returns false.
override def from (from : A) : SortedMap[A, B]
Creates a ranged projection of this collection with no upper-bound.
override def range (from : A, until : A) : SortedMap[A, B]
Creates a ranged projection of this collection with both a lower-bound and an upper-bound.
override abstract def rangeImpl (from : Option[A], until : Option[A]) : SortedMap[A, B]
Creates a ranged projection of this collection. Any mutations in the ranged projection will update this collection and vice versa. Keys are garuanteed to be consistent between the collection and its projection.
override def transform [C](f : (A, B) => C) : SortedMap[A, C]
This function transforms all the values of mappings contained in this map with function f.
override def until (until : A) : SortedMap[A, B]
Creates a ranged projection of this collection with no lower-bound.
override abstract def update [B1 >: B](key : A, value : B1) : SortedMap[A, B1]
This method allows one to create a new map with an additional mapping from key to value. If the map contains already a mapping for key, it will be overridden by this function.
Methods inherited from SortedMap
firstKey, lastKey, keySet
Methods inherited from Sorted
to, hasAll
Methods inherited from Map
withDefault, withDefaultValue, +, incl, incl, excl, excl, mappingToString
Methods inherited from Map
size (abstract), get (abstract), getOrElse, isEmpty, apply, contains, isDefinedAt, keys, values, equals, hashCode, toString, default, projection, filterKeys, mapElements, stringPrefix
Methods inherited from Collection
toArray
Methods inherited from Iterable
elements (abstract), concat, ++, map, flatMap, partition, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toSeq, toStream, mkString, mkString, mkString, addString, addString, copyToArray, hasDefiniteSize
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from AnyRef
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Methods inherited from Ranged
compare (abstract)
Method Details
override abstract def rangeImpl(from : Option[A], until : Option[A]) : SortedMap[A, B]
Creates a ranged projection of this collection. Any mutations in the ranged projection will update this collection and vice versa. Keys are garuanteed to be consistent between the collection and its projection.
Parameters
from - The lower-bound (inclusive) of the ranged projection. None if there is no lower bound.
until - The upper-bound (exclusive) of the ranged projection. None if there is no upper bound.
Overrides
SortedMap.rangeImpl

override def from(from : A) : SortedMap[A, B]
Creates a ranged projection of this collection with no upper-bound.
Parameters
from - The lower-bound (inclusive) of the ranged projection.
Overrides
SortedMap.from

override def until(until : A) : SortedMap[A, B]
Creates a ranged projection of this collection with no lower-bound.
Parameters
until - The upper-bound (exclusive) of the ranged projection.
Overrides
SortedMap.until

override def range(from : A, until : A) : SortedMap[A, B]
Creates a ranged projection of this collection with both a lower-bound and an upper-bound.
Parameters
from - The upper-bound (exclusive) of the ranged projection.
until - ...
Returns
...
Overrides
SortedMap.range

override abstract def empty[C] : SortedMap[A, C]
This method returns a new map instance of the same class mapping keys of the same type to values of type C.
Overrides
Map.empty

override abstract def update[B1 >: B](key : A, value : B1) : SortedMap[A, B1]
This method allows one to create a new map with an additional mapping from key to value. If the map contains already a mapping for key, it will be overridden by this function.
Parameters
key - ...
value - ...
Returns
the created map
Deprecated
use +({A, B}) instead
Overrides
Map.update

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

override def +[B1 >: B](kv1 : (A, B1), kv2 : (A, B1), kvs : (A, B1)*) : SortedMap[A, B1]
Add two or more key/value pairs to this map.
Parameters
kv1 - the first key/value pair.
kv2 - the second key/value pair.
kvs - the remaining key/value pairs.
Returns
A new map with the new bindings added
Overrides
Map.+

override def ++[B1 >: B](kvs : Iterable[(A, B1)]) : SortedMap[A, B1]
Add a sequence of key/value pairs to this map.
Parameters
kvs - the iterable object containing all key/value pairs.
Returns
A new map with the new bindings added
Overrides
Map.++

override def ++[B1 >: B](kvs : Iterator[(A, B1)]) : SortedMap[A, B1]
Add a sequence of key/value pairs to this map.
Parameters
kvs - the iterator containing all key/value pairs.
Returns
A new map with the new bindings added
Overrides
Map.++

override abstract def -(key : A) : SortedMap[A, B]
Remove a key from this map
Parameters
key - the key to be removed
Returns
If the map does not contain a binding for key it is returned unchanged. Otherwise, return a new map without a binding for key
Overrides
Map.-

override def -(key1 : A, key2 : A, keys : A*) : SortedMap[A, B]
Remove two or more keys from this map
Parameters
key1 - the first key to be removed
key2 - the second key to be removed
keys - the remaining keys to be removed
Returns
A map without bindings for keys If the map is mutable, the bindings are removed in place and the map itself is returned. If the map is immutable, a new map with the bindings removed is returned.
Overrides
Map.-

override def --(keys : Iterable[A]) : SortedMap[A, B]
Remove a sequence of keys from this map
Parameters
keys - the keys to be removed
Returns
A map without bindings for the given keys. If the map is mutable, the bindings are removed in place and the map itself is returned. If the map is immutable, a new map with the bindings removed is returned.
Overrides
Map.--

override def --(keys : Iterator[A]) : SortedMap[A, B]
Remove a sequence of keys from this map
Parameters
keys - the keys to be removed
Returns
A map without bindings for the given keys. If the map is mutable, the bindings are removed in place and the map itself is returned. If the map is immutable, a new map with the bindings removed is returned.
Overrides
Map.--

override def transform[C](f : (A, B) => C) : SortedMap[A, C]
This function transforms all the values of mappings contained in this map with function f.
Parameters
f - A function over keys and values
Returns
the updated map
Overrides
Map.transform

override def filter(p : ((A, B)) => Boolean) : SortedMap[A, B]
This method removes all the mappings for which the predicate p returns false.
Parameters
p - A prediacte over key-value pairs
Returns
the updated map
Overrides
Map.filter