|
Scala
1.2.0.1 |
|||
ListMap
represent
empty maps; they can be either created by calling the constructor
directly, or by applying the function ListMap.Empty
.
Method Summary | |
def -(key: A): ListMap[A,B]
This creates a new mapping without the given key .
|
|
def elements: Iterator[Tuple2[A,B]]
This returns an iterator over key-value pairs. |
|
def empty[C]: ListMap[A,C]
This method returns a new ListMap instance mapping keys of the same type to values of type C .
|
|
override
|
def equals(obj: Any): Boolean
Compares two maps for equality. |
def get(key: A): Option[B]
Check if this map maps key to a value and return the
value if it exists.
|
|
override
|
def hashCode(): Int
|
def size: Int
Returns the number of mappings in this map. |
|
override
|
def toList: List[Tuple2[A,B]]
This return a list of key-value pairs. |
def update(key: A, value: B): ListMap[A,B]
This method allows one to create a new map with an additional mapping from key
to value .
|
Methods inherited from java/lang/Object-class |
clone, 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 |
apply, contains, exists, forall, foreach, isDefinedAt, isEmpty, keys, values |
Methods inherited from scala/collection/immutable/Map-class |
+, MapTo, excl, excl, filter, incl, incl, map, mappingToString, toString |
Class Summary | |
protected
|
class Node(key: A, value: B)
|
Method Detail |
def empty[C]: ListMap[A,C]
C
.
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
def update(key: A, value: B): ListMap[A,B]
key
to value
. If the map contains already a
mapping for key
, it will be overridden by this
function.
def -(key: A): ListMap[A,B]
key
.
If the map does not contain a mapping for the given key, the
method returns the same map.
def elements: Iterator[Tuple2[A,B]]
override def toList: List[Tuple2[A,B]]
override def equals(obj: Any): Boolean
override def hashCode(): Int
|
Scala
1.2.0.1 |
|||