scala.collection.immutable

trait SortedMap

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

trait SortedMap[A, +B]
extends Map[A, B] with SortedMap[A, B] with MapLike[A, B, SortedMap[A, B]] with SortedMapLike[A, B, SortedMap[A, B]]
A map whose keys are sorted.
Author
Sean McDirmid
Martin Odersky
Version
2.8
Since
2.4
Direct Known Subclasses:
TreeMap

Method Summary
def + [B1 >: B](kv : (A, B1)) : SortedMap[A, B1]
Add a key/value pair to this map.
override def + [B1 >: B](elem1 : (A, B1), elem2 : (A, B1), elems : (A, B1)*) : SortedMap[A, B1]
Adds two or more elements to this collection and returns a new collection.
override def ++ [B1 >: B](elems : Traversable[(A, B1)]) : SortedMap[A, B1]
Adds a number of elements provided by a traversable object and returns a new collection with the added elements.
override def ++ [B1 >: B](iter : Iterator[(A, B1)]) : SortedMap[A, B1]
Adds a number of elements provided by an iterator and returns a new collection with the added elements.
protected[this] override def newBuilder : Builder[(A, B), SortedMap[A, B]]
A common implementation of `newBuilder` for all maps in terms of `empty`. Overridden for mutable maps in `mutable.MapLike`.
override def updated [B1 >: B](key : A, value : B1) : SortedMap[A, B1]
Add a key/value pair to this map.
Methods inherited from SortedMap
empty
Methods inherited from SortedMapLike
ordering (abstract), rangeImpl (abstract), firstKey, lastKey, keySet
Methods inherited from Sorted
compare, from, until, range, to, hasAll
Methods inherited from Map
withDefault, withDefaultValue
Methods inherited from MapLike
transform, filterNot, update
Methods inherited from MapLike
get (abstract), iterator (abstract), - (abstract), isEmpty, getOrElse, apply, contains, isDefinedAt, 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
protected[this] override def newBuilder : Builder[(A, B), SortedMap[A, B]]
A common implementation of `newBuilder` for all maps in terms of `empty`. Overridden for mutable maps in `mutable.MapLike`.
Overrides
SortedMap.newBuilder

override def updated[B1 >: B](key : A, value : B1) : SortedMap[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
Map.updated, MapLike.updated, SortedMapLike.updated

def +[B1 >: B](kv : (A, B1)) : SortedMap[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
Notes
needs to be overridden in subclasses
Overrides
Map.+, MapLike.+, SortedMapLike.+

override def +[B1 >: B](elem1 : (A, B1), elem2 : (A, B1), elems : (A, B1)*) : SortedMap[A, B1]
Adds two or more elements to this collection and returns a new collection.
Parameters
elem1 - the first element to add.
elem2 - the second element to add.
elems - the remaining elements to add.
Overrides
MapLike.+, SortedMapLike.+

override def ++[B1 >: B](elems : Traversable[(A, B1)]) : SortedMap[A, B1]
Adds a number of elements provided by a traversable object and returns a new collection with the added elements.
Parameters
elems - the traversable object.
Overrides
MapLike.++

override def ++[B1 >: B](iter : Iterator[(A, B1)]) : SortedMap[A, B1]
Adds a number of elements provided by an iterator and returns a new collection with the added elements.
Parameters
iter - the iterator
Overrides
MapLike.++