|
Scala
1.2.0.1 |
|||
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
This method removes a mapping from the given key .
|
|
override
|
def apply(key: A): B
Retrieve the value which is associated with the given key. |
override
|
def clear: Unit
Removes all mappings from the map. |
override
|
def contains(key: A): Boolean
Is the given key mapped to a value by this map? |
def elements: Iterator[Tuple2[A,B]]
Creates a new iterator over all elements contained in this object. |
|
protected
|
def empty: Map[A,B]
|
override
|
def filter(p: (A,B) => Boolean): Unit
This method removes all the mappings for which the predicate p returns false .
|
override
|
def foreach(f: (A,B) => Unit): Unit
Executes the given function for all (key, value) pairs contained in this map. |
def foreach(f: (A) => Unit): 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 if it exists.
|
|
protected
|
var imap: Map[A,B]
|
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 keys: Iterator[A]
Creates an iterator for all keys. |
override
|
def map(f: (A,B) => B): Unit
This function transforms all the values of mappings contained in this map with function f .
|
override
|
def mappingToString(p: Tuple2[A,B]): String
This method controls how a mapping is represented in the string representation provided by method toString .
|
def size: Int
Compute the number of key-to-value mappings. |
|
override
|
def toList: List[Tuple2[A,B]]
Returns the mappings of this map as a list. |
override
|
def toString(): String
Returns a string representation of this map which shows all the mappings. |
def update(key: A, value: B): Unit
This method allows one to add a new mapping from key
to value to the map.
|
|
override
|
def values: Iterator[B]
Creates an iterator for a contained values. |
Methods inherited from java/lang/Object-class |
eq, finalize, getClass, notify, notifyAll, synchronized, wait, wait, wait |
Methods inherited from scala/Any-class |
!=, ==, asInstanceOf, isInstanceOf, match |
Methods inherited from scala/Iterable-class |
/:, :\, exists, find, foldLeft, foldRight, forall, foreach, sameElements |
Methods inherited from scala/collection/Map-class |
equals, exists, forall |
Methods inherited from scala/collection/mutable/Map-class |
++=, ++=, +=, --=, --=, <<, clone, excl, hashCode, incl |
Method Detail |
protected var imap: Map[A,B]
def size: Int
def get(key: A): Option[B]
key
to a value and return the
value if it exists.
key
-
the key of the mapping of interest
override def isEmpty: Boolean
override def apply(key: A): B
key
-
the key
override def contains(key: A): Boolean
key
-
the key
override def isDefinedAt(key: A): Boolean
key
-
the key
override def keys: Iterator[A]
override def values: Iterator[B]
def elements: Iterator[Tuple2[A,B]]
override def foreach(f: (A,B) => Unit): Unit
f
-
the function to execute.
def foreach(f: (A) => Unit): Unit
f
to all elements of this
iterable object.
f
-
a function that is applied to every element.
override def toList: List[Tuple2[A,B]]
override def toString(): String
def update(key: A, value: B): Unit
key
to value
to the map. If the map already contains a
mapping for key
, it will be overridden by this
function.
def -=(key: A): Unit
key
.
If the map does not contain a mapping for the given key, the
method does nothing.
override def clear: Unit
override def map(f: (A,B) => B): Unit
f
.
override def filter(p: (A,B) => Boolean): Unit
p
returns false
.
override def mappingToString(p: Tuple2[A,B]): String
toString
.
protected def empty: Map[A,B]
|
Scala
1.2.0.1 |
|||