in scala/collection/immutable/ListMap-class
class Node
-
protected class Node(key: A, value: B)
- extends ListMap[A,B]
- with ScalaObject
Method Summary
|
override
|
def -(k: A): ListMap[A,B]
This creates a new mapping without the given key .
|
override
|
def apply(k: A): B
Retrieve the value which is associated with the given key.
|
override
|
def get(k: A): Option[B]
Check if this map maps key to a value and return the
value if it exists.
|
override
|
def hashCode(): Int
|
override
|
def isEmpty: Boolean
Is this an empty map?
|
override
|
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.
|
override
|
def update(k: A, v: 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, ne, notify, notifyAll, synchronized, wait, wait, wait |
size
override def size: Int
-
Returns the number of mappings in this map.
- Returns:
-
number of mappings.
isEmpty
override def isEmpty: Boolean
-
Is this an empty map?
- Returns:
-
true, iff the map is empty.
apply
override def apply(k: 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.
- Parameters:
key
-
the key
- Returns:
-
the value associated with the given key.
get
override def get(k: A): Option[B]
-
Check if this map maps
key
to a value and return the
value if it exists.
- Parameters:
key
-
the key of the mapping of interest
- Returns:
-
the value of the mapping, if it exists
update
override def update(k: A, v: B): ListMap[A,B]
-
This method allows one to create a new map with an
additional mapping from
key
to value
. If the map contains already a
mapping for key
, it will be overridden by this
function.
-
override def -(k: A): ListMap[A,B]
-
This creates a new mapping without the given
key
.
If the map does not contain a mapping for the given key, the
method returns the same map.
toList
override def toList: List[Tuple2[A,B]]
-
This return a list of key-value pairs.
hashCode
override def hashCode(): Int