Scala Library Documentation
|
|
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
Add a key/value pair to this map.
|
override def
|
+=
(pair : (K, E)) : Unit
Add a key/value pair to this map.
|
override def
|
-
(key : K) : Map
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)]
Creates a new iterator over all elements contained in this
object.
|
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) : Map[K, F] |
override def
|
projection
: Projection
returns a facade that can be used to call non-strict
filter ,
map , and flatMap methods that build projections
of the collection. |
abstract def
|
put (key : K, elem : E) : Option[E] |
def
|
putAll (that : Iterable[(K, E)]) : Unit |
def
|
remove (key : K) : Option[E] |
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
: MutableIterable[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, +=, incl, excl |
Methods inherited from Map | |
size (abstract), getOrElse, apply, contains, isDefinedAt, values, equals, hashCode, toString, default |
Methods inherited from PartialFunction | |
orElse, andThen |
Methods inherited from Function1 | |
compose |
Methods inherited from MutableIterable | |
remove, removeAll, --, -, retain, retainAll, size0 |
Methods inherited from Collection | |
toArray, stringPrefix |
Methods inherited from Iterable | |
concat, ++, map, flatMap, filter, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, mkString, mkString, 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 Map[K, E]
|
protected class
|
KeySet
extends Set[K]
|
protected class
|
Lense
[F](f : (E) => F, g : (F) => E) extends Map[K, F]
|
trait
|
MutableIterableProjection
extends Projection
|
trait
|
Projection
extends MutableIterableProjection with Projection
|
Method Details |
override
def
clear : Unit
override
def
isEmpty : Boolean
true
iff the map is empty.override final
def
keys : MutableIterator[K]
def
valueSet : MutableIterable[E]
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
filter
,
map
, and flatMap
methods that build projections
of the collection.
Scala Library Documentation
|
|