Scala Library
|
|
class
ImmutableMapAdaptor[A, B](protected val
imap : Map[A, B])
extends
Map[A, B]empty
has
to be redefined if the immutable map on which this mutable map is
originally based is not empty. empty
is supposed to
return the representation of an empty map.Method Summary | |
def
|
-=
(key : A) : Unit
Remove a key from this map, noop if key is not 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 mappings from the map. After this operation is
completed, the map is empty.
|
override def
|
contains
(key : A) : Boolean
Is the given key mapped to a value by this map?
|
def
|
elements
: Iterator[(A, B)]
Creates a new iterator over all elements contained in this
object.
|
def
|
get
(key : A) : Option[B]
Check if this map maps
key to a value and return the
value if it exists. |
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?
|
override def
|
keySet : Set[A] |
override def
|
keys
: Iterator[A]
Creates an iterator for all keys.
|
override def
|
retain
(p : (A, B) => Boolean) : Unit
This method retains only those mappings for which the predicate
p returns true . |
def
|
size
: Int
Compute the number of key-to-value mappings.
|
override def
|
toList
: List[(A, B)]
Returns a list containing all of the elements in this iterable object.
|
override def
|
toString
: java.lang.String
Creates a string representation for this map.
|
override def
|
transform
(f : (A, B) => B) : Unit
This function transforms all the values of mappings contained
in this map with function
f . |
def
|
update
(key : A, value : B) : Unit
This method allows one to add a new mapping from
key
to value to the map. If the map already contains a
mapping for key , it will be overridden by this
function. |
override def
|
values
: Iterator[B]
Creates an iterator for a contained values.
|
Methods inherited from Map | |
+=, +=, ++=, ++=, +, +, ++, ++, -=, --=, --=, -, removeKey, put, -, --, --, getOrElseUpdate, <<, clone, readOnly, +=, incl, excl |
Methods inherited from Map | |
getOrElse, equals, hashCode, default, projection, filterKeys, mapElements, stringPrefix |
Methods inherited from Collection | |
toArray |
Methods inherited from Iterable | |
concat, ++, map, flatMap, filter, partition, takeWhile, dropWhile, take, drop, foreach, 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, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
def
size : Int
key
to a value and return the
value if it exists.key -
the key of the mapping of interestoverride
def
isEmpty : Boolean
true
iff the map is empty.key -
the keykey -
the keytrue
iff there is a mapping for key in this mapkey -
the keytrue
iff there is a mapping for key in this mapkey
to value
to the map. If the map already contains a
mapping for key
, it will be overridden by this
function.key -
The key to updatevalue -
The new valuekey -
the key to be removedoverride
def
clear : Unit
f
.f -
The transformation to applyp
returns true
.p -
The test predicateoverride
def
toString : java.lang.String
Scala Library
|
|