|
Scala Library
|
|
class
TreeHashMap[Key, +Value](private underlying : IntMap[scala.collection.immutable.AssocMap[Key, Value]])
extends Map[Key, Value]| Value Summary | |
override lazy val
|
size
: Int
Compute the number of key-to-value mappings.
|
| Method Summary | |
override def
|
++
[V >: Value](that : Iterable[(Key, V)]) : TreeHashMap[Key, V]
Add a sequence of key/value pairs to this map.
|
def
|
++ [V >: Value](that : TreeHashMap[Key, V]) : TreeHashMap[Key, V] |
def
|
-
(key : Key) : TreeHashMap[Key, Value]
Remove a key from this map
|
override def
|
apply
(key : Key) : Value
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.
|
def
|
elements
: Iterator[(Key, Value)]
Creates a new iterator over all elements contained in this
object.
|
def
|
empty
[V] : TreeHashMap[Key, V]
This method returns a new map instance of the same class
mapping keys of the same type to values of type
C. |
override def
|
equals
(that : Any) : Boolean
Compares two maps structurally; i.e. checks if all mappings
contained in this map are also contained in the other map,
and vice versa.
|
override def
|
filter
(f : ((Key, Value)) => Boolean) : TreeHashMap[Key, Value]
This method removes all the mappings for which the predicate
p returns false. |
override def
|
foreach
(f : ((Key, Value)) => Unit) : Unit
Apply a function
f to all elements of this
iterable object. |
def
|
get
(key : Key) : Option[Value]
Check if this map maps
key to a value and return the
value if it exists. |
override def
|
hashCode
: Int
A hash method compatible with
equals |
override def
|
isEmpty
: Boolean
Is this an empty map?
|
override def
|
stringPrefix
: java.lang.String
Defines the prefix of this object's
toString representation. |
override def
|
toList
: List[(Key, Value)]
Returns a list containing all of the elements in this iterable object.
|
override def
|
transform
[C](f : (Key, Value) => C) : TreeHashMap[Key, C]
This function transforms all the values of mappings contained
in this map with function
f. |
def
|
update
[S >: Value](key : Key, value : S) : TreeHashMap[Key, S]
This method allows one to create a new map with an
additional mapping from
key
to value. If the map contains already a
mapping for key, it will be overridden by this
function. |
| Methods inherited from Map | |
| +, +, ++, -, --, --, withDefault, withDefaultValue, +, incl, incl, excl, excl, mappingToString |
| Methods inherited from Map | |
| getOrElse, contains, isDefinedAt, keys, keySet, values, toString, default, projection, filterKeys, mapElements |
| Methods inherited from Collection | |
| toArray |
| Methods inherited from Iterable | |
| concat, ++, map, flatMap, partition, takeWhile, dropWhile, take, drop, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, 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 |
| Value Details |
override
lazy val
size : Int
| Method Details |
def
empty[V] : TreeHashMap[Key, V]
C.override
def
stringPrefix : java.lang.String
toString representation.that - the other maptrue iff both maps contain exactly the same mappings.override
def
hashCode : Int
equalsf to all elements of this
iterable object.f - a function that is applied to every element.key - the keyoverride
def
isEmpty : Boolean
true iff the map is empty.p returns false.p - A prediacte over key-value pairsf.f - A function over keys and valueskey to a value and return the
value if it exists.key - the key of the mapping of interestkey
to value. If the map contains already a
mapping for key, it will be overridden by this
function.key - ...value - ...+({A, B}) instead
def
-(key : Key) : TreeHashMap[Key, Value]
key - the key to be removedkey it is returned unchanged. Otherwise, return a new map
without a binding for keykvs - the iterable object containing all key/value pairs.
def
++[V >: Value](that : TreeHashMap[Key, V]) : TreeHashMap[Key, V]
|
Scala Library
|
|