scala.collection

trait SortedMapLike

[source: scala/collection/SortedMapLike.scala]

trait SortedMapLike[A, +B, +This <: SortedMapLike[A, B, This] with SortedMap[A, B]]
extends Sorted[A, This] with MapLike[A, B, This]
A template for maps whose keys are sorted. To create a concrete sorted map, you need to implement the rangeImpl method, in addition to those of `MapLike`.
Author
Sean McDirmid
Martin Odersky
Version
2.8
Since
2.8
Direct Known Subclasses:
SortedMap, SortedMap, 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 either the collection itself (if it is mutable), or a new collection with the added elements.
abstract def + [B1 >: B](kv : (A, B1)) : SortedMap[A, B1]
Add a key/value pair to this map.
def firstKey : A
Returns the first key of the collection.
override def keySet : SortedSet[A]
def lastKey : A
Returns the last key of the collection.
implicit abstract def ordering : Ordering[A]
abstract def rangeImpl (from : Option[A], until : Option[A]) : This
Creates a ranged projection of this collection. Any mutations in the ranged projection will update this collection and vice versa. Note: keys are not garuanteed to be consistent between this collection and the projection. This is the case for buffers where indexing is relative to the projection.
override def updated [B1 >: B](key : A, value : B1) : SortedMap[A, B1]
Add a key/value pair to this map.
Methods inherited from MapLike
empty (abstract), get (abstract), iterator (abstract), - (abstract), newBuilder, 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 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 TraversableLike
repr, nonEmpty, size, hasDefiniteSize, ++, ++, map, flatMap, filter, filterNot, 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 PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from Sorted
compare, from, until, range, to, hasAll
Methods inherited from AnyRef
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
protected class DefaultKeySortedSet extends DefaultKeySet with SortedSet[A]
Method Details
def firstKey : A
Returns the first key of the collection.
Overrides
Sorted.firstKey

def lastKey : A
Returns the last key of the collection.
Overrides
Sorted.lastKey

implicit abstract def ordering : Ordering[A]
Overrides
Sorted.ordering

abstract def rangeImpl(from : Option[A], until : Option[A]) : This
Creates a ranged projection of this collection. Any mutations in the ranged projection will update this collection and vice versa. Note: keys are not garuanteed to be consistent between this collection and the projection. This is the case for buffers where indexing is relative to the 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
Sorted.rangeImpl

override def keySet : SortedSet[A]
Returns
the keys of this map as a set.
Overrides
Sorted.keySet, MapLike.keySet

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
MapLike.updated

abstract 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
MapLike.+

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 either the collection itself (if it is mutable), or a new collection with the added elements.
Parameters
elem1 - the first element to add.
elem2 - the second element to add.
elems - the remaining elements to add.
Overrides
MapLike.+