Scala Library
|
|
scala/collection/jcl/Map.scala
]
trait
Map[K, E]
extends
MutableIterable[(K, E)] with
Map[K, E]Method Summary | |
override def
|
+
(pair : (K, E)) : Map[K, E]
Add a key/value pair to this map.
|
override def
|
++=
(that : Iterable[(K, E)]) : Unit
Add a sequence of key/value pairs to this map.
|
override def
|
+=
(pair : (K, E)) : Unit
Add a key/value pair to this map.
|
override def
|
-
(key : K) : Map[K, E]
Remove a key from this map
|
override def
|
-=
(key : K) : Unit
Remove a key from this map, noop if key is not present.
|
override def
|
clear
: Unit
Removes all mappings from the map. After this operation is
completed, the map is empty.
|
override abstract def
|
elements
: MutableIterator[(K, E)]
The default implementation of a map over mutable iterable collections.
|
override def
|
filterKeys
(p : (K) => Boolean) : Projection[K, E]
non-strict filter based on keys only
|
override def
|
get
(key : K) : Option[E]
Check if this map maps
key to a value and return the
value if it exists. |
override def
|
has (pair : (K, E)) : Boolean |
override def
|
isEmpty
: Boolean
Is this an empty map?
|
override def
|
keySet : Set[K] |
override final def
|
keys
: MutableIterator[K]
Creates an iterator for all keys.
|
def
|
lense [F](f : (E) => F, g : (F) => E) : Projection[K, F] |
override def
|
projection
: Projection[K, E]
returns a projection that can be used to call non-strict
filter ,
map , and flatMap methods that build projections
of the collection. |
override def
|
put
(key : K, elem : E) : Option[E]
Map
key to elem in this map and return the element
that the key was previously mapped to (if any). |
override def
|
remove (p : (K, E)) : Boolean |
override def
|
removeKey
(key : K) : Option[E]
Remove
key from this map and return the element
that the key was previously mapped to (if any). |
override def
|
update
(key : K, e : E) : 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. |
def
|
valueSet
: Projection[E]
The values of this map as a projection, which means
removals from the returned collection will remove the element from this map.
|
Methods inherited from Map | |
+=, ++=, +, ++, ++, -=, --=, --=, -, --, --, getOrElseUpdate, transform, retain, <<, clone, readOnly, +=, incl, excl |
Methods inherited from Map | |
size (abstract), getOrElse, apply, contains, isDefinedAt, values, equals, hashCode, toString, default, mapElements, stringPrefix |
Methods inherited from PartialFunction | |
orElse, andThen |
Methods inherited from Function1 | |
compose |
Methods inherited from MutableIterable | |
removeAll, --, -, retainOnly, retainAll, size0 |
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, toList, toSeq, toStream, mkString, mkString, mkString, addString, addString, addString, copyToArray, hasDefiniteSize |
Methods inherited from AnyRef | |
getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Class Summary | |
protected class
|
Filter
(p : (K) => Boolean) extends Projection[K, E]
|
protected class
|
KeySet
extends Set[K]
|
protected class
|
Lense
[F](f : (E) => F, g : (F) => E) extends Projection[K, F]
|
Method Details |
override
def
clear : Unit
override
def
isEmpty : Boolean
true
iff the map is empty.override final
def
keys : MutableIterator[K]
def
valueSet : Projection[E]
key
to elem
in this map and return the element
that the key was previously mapped to (if any).kvs -
the iterable object containing all key/value pairs.key
from this map and return the element
that the key was previously mapped to (if any).key
to a value and return the
value if it exists.key -
the key of the mapping of interestkey
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 valuekv -
the key/value pair.kv -
the key/value pair.key -
the key to be removedkey
removed if it existed.key -
the key to be removedoverride abstract
def
elements : MutableIterator[(K, E)]
override
def
projection : Projection[K, E]
filter
,
map
, and flatMap
methods that build projections
of the collection.override
def
filterKeys(p : (K) => Boolean) : Projection[K, E]
Scala Library
|
|