scala.collection.immutable

trait SortedMap

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

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

Method Summary
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.
def + [B1 >: B](kv : (A, B1)) : SortedMap[A, B1]
Add a key/value pair to this map.
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.
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.
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 `MutableMapTemplate`.
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 SortedMapTemplate
ordering (abstract), rangeImpl (abstract), firstKey, lastKey, keySet
Methods inherited from Sorted
compare, from, until, range, to, hasAll
Methods inherited from Map
hashCode, withDefault, withDefaultValue
Methods inherited from ImmutableMapTemplate
transform, filterNot, update
Methods inherited from MapTemplate
get (abstract), iterator (abstract), - (abstract), isEmpty, getOrElse, apply, contains, isDefinedAt, keysIterator, keys, valueIterable, valuesIterator, values, default, filterKeys, mapValues, mapElements, addString, equals, stringPrefix, toString
Methods inherited from Subtractable
-, --, --
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from Iterable
companion
Methods inherited from IterableTemplate
elements, foreach, foldRight, reduceRight, toIterable, head, takeRight, dropRight, sameElements, toStream, view, view, first, firstOption, toSeq, projection
Methods inherited from TraversableClass
genericBuilder, unzip, flatten, transpose
Methods inherited from TraversableTemplate
thisCollection, nonEmpty, size, hasDefiniteSize, ++, ++, map, flatMap, filter, filterMap, remove, partition, groupBy, forall, exists, count, find, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, headOption, tail, last, lastOption, init, take, drop, slice, takeWhile, dropWhile, span, splitAt, copyToBuffer, copyToArray, copyToArray, toArray, toList, toSequence, toSet, mkString, mkString, mkString, addString, addString
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 `MutableMapTemplate`.
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, ImmutableMapTemplate.updated, SortedMapTemplate.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.+, ImmutableMapTemplate.+, SortedMapTemplate.+

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
ImmutableMapTemplate.+, SortedMapTemplate.+

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
ImmutableMapTemplate.++

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
ImmutableMapTemplate.++