Scala Library
|
|
scala/collection/immutable/TreeMap.scala
]
class
TreeMap[A, +B](val
size : Int, t : Tree[B], implicit
view$4 : (A) => Ordered[A])
extends
RedBlack[A] with
SortedMap[A, B]Additional Constructor Summary | |
def
|
this
()(implicit view$5 : (A) => Ordered[A]) : TreeMap[A, B]
|
Value Summary | |
protected val
|
tree : Tree[B] |
Method Summary | |
def
|
-
(key : A) : TreeMap[A, B]
Remove a key from this map
|
override def
|
apply
(key : A) : B
Retrieve the value which is associated with the given key. This
method throws an exception if there is no mapping from the given
key to a value.
|
override def
|
compare
(k0 : A, k1 : A) : Int
Comparison function that orders keys.
|
def
|
elements
: Iterator[(A, B)]
Creates a new iterator over all elements contained in this
object.
|
def
|
empty
[C] : TreeMap[A, C]
A factory to create empty maps of the same type of keys.
|
override def
|
exists
(f : ((A, B)) => Boolean) : Boolean
Apply a predicate
p to all elements of this
iterable object and return true, iff there is at least one
element for which p yields true. |
override def
|
firstKey
: A
Returns the first key of the collection.
|
override def
|
forall
(f : ((A, B)) => Boolean) : Boolean
Apply a predicate
p to all elements of this
iterable object and return true, iff the predicate yields
true for all elements. |
override def
|
foreach
(f : ((A, B)) => Unit) : Unit
Apply a function
f to all elements of this
iterable object. |
override def
|
get
(key : A) : Option[B]
Check if this map maps
key to a value and return the
value if it exists. |
def
|
insert
[B1 >: B](key : A, value : B1) : TreeMap[A, B1]
A new TreeMap with the entry added is returned,
assuming that key is not in the TreeMap.
|
def
|
isSmaller (x : A, y : A) : Boolean |
override def
|
lastKey
: A
Returns the last key of the collection.
|
override 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.
|
def
|
update
[B1 >: B](key : A, value : B1) : TreeMap[A, B1]
A new TreeMap with the entry added is returned,
if key is not in the TreeMap, otherwise
the key is updated with the new entry.
|
Methods inherited from SortedMap | |
from, until, range, +, +, ++, ++, -, --, --, transform, filter |
Methods inherited from SortedMap | |
keySet |
Methods inherited from Sorted | |
to, hasAll |
Methods inherited from Map | |
withDefault, withDefaultValue, +, incl, incl, excl, excl, mappingToString |
Methods inherited from Map | |
getOrElse, isEmpty, contains, isDefinedAt, keys, values, equals, hashCode, toString, default, projection, filterKeys, mapElements, stringPrefix |
Methods inherited from Collection | |
toArray |
Methods inherited from Iterable | |
concat, ++, map, flatMap, partition, takeWhile, dropWhile, take, drop, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toSeq, toStream, mkString, mkString, mkString, addString, 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 |
Additional Constructor Details |
Value Details |
Method Details |
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.override
def
firstKey : A
override
def
lastKey : A
key -
...value -
...key -
the key to be removedkey
it is returned unchanged. Otherwise, return a new map
without a binding for key
key
to a value and return the
value if it exists.key -
the key of the mapping of interestkey -
the keyError("key -
not found").f
to all elements of this
iterable object.f -
a function that is applied to every element.p
to all elements of this
iterable object and return true, iff the predicate yields
true for all elements.p -
the predicatep
to all elements of this
iterable object and return true, iff there is at least one
element for which p
yields true.p -
the predicate
Scala Library
|
|