scala.collection

SortedMap

trait SortedMap[A, +B] extends Map[A, B] with SortedMapLike[A, B, SortedMap[A, B]]

A map whose keys are sorted.

known subclasses: SortedMap

Inherits

  1. SortedMapLike
  2. Sorted
  3. Map
  4. MapLike
  5. Subtractable
  6. PartialFunction
  7. Function1
  8. Iterable
  9. IterableLike
  10. Equals
  11. Traversable
  12. GenericTraversableTemplate
  13. TraversableLike
  14. HasNewBuilder
  15. AnyRef
  16. Any

Type Members

  1. class WithFilter extends AnyRef

    A class supporting filtered operations

Value Members

  1. 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

  2. def +[B1 >: B](kv: (A, B1)): SortedMap[A, B1]

    Add a key/value pair to this map

  3. def ++[B1 >: B](iter: Iterator[(A, B1)]): Map[A, B1]

    Adds all key/value pairs produced by an iterator to this map, returning a new map

  4. def ++[B1 >: B](kvs: Traversable[(A, B1)]): Map[A, B1]

    Adds all key/value pairs in a traversable collection to this map, returning a new map

  5. def ++[B >: (A, B), That](that: Iterator[B])(bf: CanBuildFrom[SortedMap[A, B], B, That]): That

    Concatenates this map with the elements of an iterator

  6. def ++[B >: (A, B), That](that: Traversable[B])(bf: CanBuildFrom[SortedMap[A, B], B, That]): That

    Concatenates this map with the elements of a traversable collection

  7. def -(elem1: A, elem2: A, elems: A*): SortedMap[A, B]

    Creates a new map from this map with some elements removed

  8. def -(key: A): SortedMap[A, B]

    Removes a key from this map, returning a new map

  9. def --(iter: Iterator[A]): SortedMap[A, B]

    Creates a new map from this map by removing all elements produced by an iterator

  10. def --(elems: Traversable[A]): SortedMap[A, B]

    Creates a new map from this map by removing all elements of another collection

  11. def /:[B](z: B)(op: (B, (A, B)) ⇒ B): B

    Applies a binary operator to a start value and all elements of this map, going left to right

  12. def :\[B](z: B)(op: ((A, B), B) ⇒ B): B

    Applies a binary operator to all elements of this map and a start value, going right to left

  13. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder

    Appends all bindings of this map to a string builder using start, end, and separator strings

  14. def addString(b: StringBuilder): StringBuilder

    Appends all elements of this map to a string builder

  15. def addString(b: StringBuilder, sep: String): StringBuilder

    Appends all elements of this map to a string builder using a separator string

  16. def andThen[C](k: (B) ⇒ C): PartialFunction[A, C]

    Composes this partial function with a transformation function that gets applied to results of this partial function

  17. def apply(key: A): B

    Retrieves the value which is associated with the given key

  18. def canEqual(that: Any): Boolean

    Method called from equality methods, so that user-defined subclasses can refuse to be equal to other collections of the same kind

  19. def companion: GenericCompanion[Iterable[A][A]]

    The factory companion object that builds instances of class Map

  20. def compare(k0: A, k1: A): Int

    Comparison function that orders keys

  21. def compose[A](g: (A) ⇒ A): (A) ⇒ B

    (f compose g)(x) == f(g(x))

  22. def contains(key: A): Boolean

    Tests whether this map contains a binding for a key

  23. def copyToArray[B >: (A, B)](xs: Array[B], start: Int, len: Int): Unit

    Copies elements of this map to an array

  24. def copyToArray[B >: (A, B)](xs: Array[B]): Unit

    Copies elements of this map to an array

  25. def copyToArray[B >: (A, B)](xs: Array[B], start: Int): Unit

    Copies elements of this map to an array

  26. def copyToBuffer[B >: (A, B)](dest: Buffer[B]): Unit

    Copies all elements of this map to a buffer

  27. def count(p: ((A, B)) ⇒ Boolean): Int

    Counts the number of elements in the map which satisfy a predicate

  28. def default(key: A): B

    Defines the default value computation for the map, returned when a key is not found The method implemented here throws an exception, but it might be overridden in subclasses

  29. def drop(n: Int): SortedMap[A, B]

    Selects all elements except first n ones

  30. def dropRight(n: Int): SortedMap[A, B]

    Selects all elements except first n ones

  31. def dropWhile(p: ((A, B)) ⇒ Boolean): SortedMap[A, B]

    Drops longest prefix of elements that satisfy a predicate

  32. def elements: Iterator[(A, B)]

  33. def empty: SortedMap[A, B]

    Needs to be overridden in subclasses

  34. def equals(that: Any): Boolean

    Compares two maps structurally; i

  35. def exists(p: ((A, B)) ⇒ Boolean): Boolean

    Tests whether a predicate holds for some of the elements of this map

  36. def filter(p: ((A, B)) ⇒ Boolean): SortedMap[A, B]

    Selects all elements of this map which satisfy a predicate

  37. def filterKeys(p: (A) ⇒ Boolean): DefaultMap[A, B]

    Filters this map by retaining only keys satisfying a predicate

  38. def filterNot(p: ((A, B)) ⇒ Boolean): SortedMap[A, B]

    Selects all elements of this map which do not satisfy a predicate

  39. def find(p: ((A, B)) ⇒ Boolean): Option[(A, B)]

    Finds the first element of the map satisfying a predicate, if any

  40. def first: (A, B)

  41. def firstKey: A

    Returns the first key of the collection

  42. def firstOption: Option[(A, B)]

    None if iterable is empty

  43. def flatMap[B, That](f: ((A, B)) ⇒ Traversable[B])(bf: CanBuildFrom[SortedMap[A, B], B, That]): That

    Builds a new collection by applying a function to all elements of this map and concatenating the results

  44. def flatten[B](asTraversable: ((A, B)) ⇒ Traversable[B]): Iterable[B]

    Converts this map of traversable collections into a map in which all element collections are concatenated

  45. def foldLeft[B](z: B)(op: (B, (A, B)) ⇒ B): B

    Applies a binary operator to a start value and all elements of this map, going left to right

  46. def foldRight[B](z: B)(op: ((A, B), B) ⇒ B): B

    Applies a binary operator to all elements of this map and a start value, going right to left

  47. def forall(p: ((A, B)) ⇒ Boolean): Boolean

    Tests whether a predicate holds for all elements of this map

  48. def foreach[U](f: ((A, B)) ⇒ U): Unit

    Applies a function f to all elements of this map

  49. def from(from: A): SortedMap[A, B]

    Creates a ranged projection of this collection with no upper-bound

  50. def genericBuilder[B]: Builder[B, Iterable[B]]

    The generic builder that builds instances of Map at arbitrary element types

  51. def get(key: A): Option[B]

    Optionally returns the value associated with a key

  52. def getOrElse[B1 >: B](key: A, default: ⇒ B1): B1

    Returns the value associated with a key, or a default value if the key is not contained in the map

  53. def groupBy[K](f: ((A, B)) ⇒ K): Map[K, SortedMap[A, B]]

    Partitions this map into a map of maps according to some discriminator function

  54. def hasDefiniteSize: Boolean

    Tests whether this map is known to have a finite size

  55. def hashCode(): Int

    Returns a hash code value for the object

  56. def head: (A, B)

    Selects the first element of this map

  57. def headOption: Option[(A, B)]

    Optionally selects the first element

  58. def init: SortedMap[A, B]

    Selects all elements except the last

  59. def isDefinedAt(key: A): Boolean

    Tests whether this map contains a binding for a key

  60. def isEmpty: Boolean

    Tests whether the map is empty

  61. def iterator: Iterator[(A, B)]

    Creates a new iterator over all key/value pairs of this map

  62. def keySet: SortedSet[A]

    Collects all keys of this map in a set

  63. def keys: Iterator[A]

    Creates an iterator for all keys

  64. def keysIterator: Iterator[A]

    Creates an iterator for all keys

  65. def last: (A, B)

    Selects the last element

  66. def lastKey: A

    Returns the last key of the collection

  67. def lastOption: Option[(A, B)]

    Optionally selects the last element

  68. def lift: (A) ⇒ Option[B]

    Turns this partial function into an plain function returning an Option result

  69. def map[B, That](f: ((A, B)) ⇒ B)(bf: CanBuildFrom[SortedMap[A, B], B, That]): That

    Builds a new collection by applying a function to all elements of this map

  70. def mapElements[C](f: (B) ⇒ C): DefaultMap[A, C]

  71. def mapValues[C](f: (B) ⇒ C): DefaultMap[A, C]

    A map view resulting from applying a given function f to each value associated with a key in this map

  72. def max[B >: (A, B)](cmp: Ordering[B]): (A, B)

    Finds the largest element

  73. def min[B >: (A, B)](cmp: Ordering[B]): (A, B)

    Finds the smallest element

  74. def mkString: String

    Displays all elements of this map in a string

  75. def mkString(sep: String): String

    Displays all elements of this map in a string using a separator string

  76. def mkString(start: String, sep: String, end: String): String

    Displays all elements of this map in a string using start, end, and separator strings

  77. def nonEmpty: Boolean

    Tests whether the map is not empty

  78. def orElse[A1 <: A, B1 >: B](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]

    Composes this partial function with a fallback partial function which gets applied where this partial function is not defined

  79. def ordering: Ordering[A]

  80. def partialMap[B, That](pf: PartialFunction[(A, B), B])(bf: CanBuildFrom[SortedMap[A, B], B, That]): That

    Builds a new collection by applying a partial function to all elements of this map on which the function is defined

  81. def partition(p: ((A, B)) ⇒ Boolean): (SortedMap[A, B], SortedMap[A, B])

    Partitions this map in two maps according to a predicate

  82. def product[B >: (A, B)](num: Numeric[B]): B

    Multiplies up the elements of this collection

  83. def projection: IterableView[(A, B), SortedMap[A, B]]

    returns a projection that can be used to call non-strict filter,map, and flatMap methods that build projections of the collection

  84. 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

  85. def rangeImpl(from: Option[A], until: Option[A]): SortedMap[A, B]

    Creates a ranged projection of this collection

  86. def reduceLeft[B >: (A, B)](op: (B, (A, B)) ⇒ B): B

    Applies a binary operator to all elements of this map, going left to right

  87. def reduceLeftOption[B >: (A, B)](op: (B, (A, B)) ⇒ B): Option[B]

    Optionally applies a binary operator to all elements of this map, going left to right

  88. def reduceRight[B >: (A, B)](op: ((A, B), B) ⇒ B): B

    Applies a binary operator to all elements of this map, going right to left

  89. def reduceRightOption[B >: (A, B)](op: ((A, B), B) ⇒ B): Option[B]

    Optionally applies a binary operator to all elements of this map, going right to left

  90. def repr: SortedMap[A, B]

    The collection of type map underlying this TraversableLike object

  91. def sameElements[B >: (A, B)](that: Iterable[B]): Boolean

    Checks if the other iterable collection contains the same elements in the same order as this map

  92. def size: Int

    The size of this map

  93. def slice(from: Int, until: Int): SortedMap[A, B]

    Selects an interval of elements

  94. def span(p: ((A, B)) ⇒ Boolean): (SortedMap[A, B], SortedMap[A, B])

    Spits this map into a prefix/suffix pair according to a predicate

  95. def splitAt(n: Int): (SortedMap[A, B], SortedMap[A, B])

    Splits this map into two at a given position

  96. def stringPrefix: String

    Defines the prefix of this object's toString representation

  97. def sum[B >: (A, B)](num: Numeric[B]): B

    Sums up the elements of this collection

  98. def tail: SortedMap[A, B]

    Selects all elements except the first

  99. def take(n: Int): SortedMap[A, B]

    Selects first n elements

  100. def takeRight(n: Int): SortedMap[A, B]

    Selects last n elements

  101. def takeWhile(p: ((A, B)) ⇒ Boolean): SortedMap[A, B]

    Takes longest prefix of elements that satisfy a predicate

  102. def to(to: A): SortedMap[A, B]

    Create a range projection of this collection with no lower-bound

  103. def toArray[B >: (A, B)](arg0: ClassManifest[B]): Array[B]

    Converts this map to an array

  104. def toIndexedSeq[B >: (A, B)]: IndexedSeq[B]

    Converts this map to an indexed sequence

  105. def toIterable: Iterable[(A, B)]

    Converts this map to an iterable collection

  106. def toList: List[(A, B)]

    Converts this map to a list

  107. def toSeq: Seq[(A, B)]

    Converts this map to a sequence

  108. def toSet[B >: (A, B)]: Set[B]

    Converts this map to a set

  109. def toStream: Stream[(A, B)]

    Converts this map to a stream

  110. def toString(): String

    Converts this map to a string

  111. def transpose[B](asTraversable: ((A, B)) ⇒ Traversable[B]): Iterable[Iterable[B]]

    Transposes this map of traversable collections into

  112. def until(until: A): SortedMap[A, B]

    Creates a ranged projection of this collection with no lower-bound

  113. def unzip[A1, A2](asPair: ((A, B)) ⇒ (A1, A2)): (Iterable[A1], Iterable[A2])

    Converts this map of pairs into two collections of the first and second halfs of each pair

  114. def updated[B1 >: B](key: A, value: B1): SortedMap[A, B1]

    Add a key/value pair to this map

  115. def values: Iterator[B]

    Creates an iterator for all contained values

  116. def valuesIterable: Iterable[B]

    Collects all values of this map in an iterable collection

  117. def valuesIterator: Iterator[B]

    Creates an iterator for all values in this map

  118. def view(from: Int, until: Int): IterableView[(A, B), SortedMap[A, B]]

    Creates a non-strict view of a slice of this map

  119. def view: IterableView[(A, B), SortedMap[A, B]]

    Creates a non-strict view of this map

  120. def withFilter(p: ((A, B)) ⇒ Boolean): WithFilter

    Creates a non-strict filter of this map

  121. def zip[A1 >: (A, B), B, That](that: Iterable[B])(bf: CanBuildFrom[SortedMap[A, B], (A1, B), That]): That

    Returns a map formed from this map and another iterable collection by combining corresponding elements in pairs

  122. def zipAll[B, A1 >: (A, B), That](that: Iterable[B], thisElem: A1, thatElem: B)(bf: CanBuildFrom[SortedMap[A, B], (A1, B), That]): That

    Returns a map formed from this map and another iterable collection by combining corresponding elements in pairs

  123. def zipWithIndex[A1 >: (A, B), That](bf: CanBuildFrom[SortedMap[A, B], (A1, Int), That]): That

    Zips this map with its indices