Scala Library
|
|
trait
SynchronizedMap[A, B]
extends
Map[A, B]Map
functions of the class into which it is mixed in.Method Summary | |
override def
|
+
(kv : (A, B)) : SynchronizedMap[A, B]
Add a new key/value mapping and return the map itself.
|
def
|
+=
(kv : (A, B)) : SynchronizedMap[A, B]
Add a new key/value mapping this map.
|
def
|
-=
(key : A) : SynchronizedMap[A, B]
Delete a key from this map if it is present.
|
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
|
clear
: Unit
Removes all elements from the set. After this operation is completed,
the set will be empty.
|
override def
|
clone
: Map
This method creates and returns a copy of the receiver object.
|
override def
|
contains
(key : A) : Boolean
Is the given key mapped to a value by this map?
|
override def
|
foreach
[U](f : ((A, B)) => U) : Unit
Apply a function
f to all elements of this
iterable object. |
def
|
get
(key : A) : Option[B]
Check if this map maps
key to a value and return the
value as an option if it exists, None if not. |
override def
|
getOrElseUpdate
(key : A, default : => B) : B
Check if this map maps
key to a value.
Return that value if it exists, otherwise put default
as that key's value and return it. |
override def
|
isDefinedAt
(key : A) : Boolean
Does this map contain a mapping from the given key to a value?
|
override def
|
isEmpty
: Boolean
Is this an empty map?
|
def
|
iterator
: Iterator[(A, B)]
An iterator yielding all key/value mappings of this map.
|
override def
|
keySet : Set[A] |
override def
|
keys
: Iterator[A]
Creates an iterator for all keys.
|
override def
|
keysIterator
: Iterator[A]
Creates an iterator for all keys.
|
override def
|
put
(key : A, value : B) : Option[B]
Adds a new mapping from
key
to value to the map. If the map already contains a
mapping for key , it will be overridden. |
override def
|
remove
(key : A) : Option[B]
If given key is defined in this map, remove it and return associated value as an Option.
If key is not present return None.
|
override def
|
retain
(p : (A, B) => Boolean) : SynchronizedMap[A, B]
Retain only those mappings for which the predicate
p returns true . |
override def
|
size
: Int
The number of elements in this collection
|
override def
|
transform
(f : (A, B) => B) : SynchronizedMap[A, B]
This function transforms all the values of mappings contained
in this map with function
f . |
override def
|
update
(key : A, value : B) : Unit
Adds a new mapping from
key
to value to the map. If the map already contains a
mapping for key , it will be overridden. |
override def
|
values
: Iterator[B]
Creates an iterator for a contained values.
|
override def
|
valuesIterable : Iterable[B] |
override def
|
valuesIterator
: Iterator[B]
Creates an iterator for a contained values.
|
Methods inherited from Map | |
empty |
Methods inherited from MapLike | |
newBuilder, updated, cached, +, ++, ++, -, removeKey, result, -, --, -- |
Methods inherited from Shrinkable | |
-=, --=, --= |
Methods inherited from Builder | |
sizeHint, mapResult |
Methods inherited from Growable | |
+=, ++=, ++= |
Methods inherited from MapLikeBase | |
+ |
Methods inherited from MapLike | |
getOrElse, default, filterKeys, mapValues, mapElements, +, ++, ++, addString, stringPrefix, toString, hashCode, equals |
Methods inherited from PartialFunction | |
orElse, andThen |
Methods inherited from Function1 | |
compose |
Methods inherited from Iterable | |
companion |
Methods inherited from IterableLike | |
thisCollection, toCollection, elements, 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 GenericTraversableTemplate | |
genericBuilder, unzip, flatten, transpose |
Methods inherited from TraversableLike | |
repr, nonEmpty, 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 AnyRef | |
getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
key
to a value and return the
value as an option if it exists, None if not.key -
the key of the mapping of interest.
def
+=(kv : (A, B)) : SynchronizedMap[A, B]
kv -
the key/value pair.
def
-=(key : A) : SynchronizedMap[A, B]
key -
the key to be removedoverride
def
size : Int
key
to value
to the map. If the map already contains a
mapping for key
, it will be overridden.key -
The key to updatevalue -
The new valuekey
to value
to the map. If the map already contains a
mapping for key
, it will be overridden.key -
The key to updatevalue -
The new valuekey -
the key to be removedoverride
def
clear : Unit
key
to a value.
Return that value if it exists, otherwise put default
as that key's value and return it.f
.f -
The transformation to applyp
returns true
.p -
The test predicateoverride
def
values : Iterator[B]
override
def
clone : Map
The default implementation of the clone
method is platform dependent.
f
to all elements of this
iterable object.f -
A function that is applied for its side-effect to every element. The result (of arbitrary type U) of function `f` is discarded.key -
the keyoverride
def
keys : Iterator[A]
override
def
isEmpty : Boolean
true
iff the map does not contain any key/value mapping.key -
the keytrue
iff there is a mapping for key in this mapkey -
the keytrue
iff there is a mapping for key in this mapoverride
def
+(kv : (A, B)) : SynchronizedMap[A, B]
kv -
the key/value mapping to be added
Scala Library
|
|