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
|
+=
(kv : (A, B)) : ImmutableMapAdaptor[A, B]
Add a new key/value mapping this map.
|
def
|
-=
(key : A) : ImmutableMapAdaptor[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
|
contains
(key : A) : Boolean
Is the given key mapped to a value by this map?
|
override def
|
elements : Iterator[(A, B)] |
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
|
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
|
retain
(p : (A, B) => Boolean) : ImmutableMapAdaptor[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
|
toList
: List[(A, B)]
Returns a list with all elements of this traversable object.
|
override def
|
toString
: java.lang.String
Need to override string, so that it's not the Function1's string that gets mixed in.
|
override def
|
transform
(f : (A, B) => B) : ImmutableMapAdaptor[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, put, updated, cached, +, +, ++, ++, remove, -, removeKey, getOrElseUpdate, clone, 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, hashCode, equals |
Methods inherited from PartialFunction | |
orElse, andThen |
Methods inherited from Function1 | |
compose |
Methods inherited from Iterable | |
companion |
Methods inherited from IterableLike | |
thisCollection, toCollection, foreach, 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, 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 |
override
def
size : Int
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.override
def
isEmpty : Boolean
true
iff the map does not contain any key/value mapping.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 mapoverride
def
keys : Iterator[A]
override
def
values : Iterator[B]
override
def
elements : Iterator[(A, B)]
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 value
def
-=(key : A) : ImmutableMapAdaptor[A, B]
key -
the key to be removed
def
+=(kv : (A, B)) : ImmutableMapAdaptor[A, B]
kv -
the key/value pair.override
def
clear : Unit
f
.f -
The transformation to applyp
returns true
.p -
The test predicateoverride
def
toString : java.lang.String
Scala Library
|
|