|
Scala Library
|
|
scala/collection/immutable/ListMap.scala]
class
ListMap[A, +B]
extends Map[A, B] with MapLike[A, B, ListMap[A, B]]ListMap represent
empty maps; they can be either created by calling the constructor
directly, or by applying the function ListMap.empty.| Method Summary | |
override def
|
+
[B1 >: B](elem1 : (A, B1), elem2 : (A, B1), elems : (A, B1)*) : ListMap[A, B1]
Adds two or more elements to this collection and returns
either the collection itself (if it is mutable), or a new collection
with the added elements.
|
def
|
+
[B1 >: B](kv : (A, B1)) : ListMap[A, B1]
Add a key/value pair to this map.
|
def
|
-
(key : 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. |
override def
|
empty : ListMap[A, Nothing] |
def
|
get
(key : A) : Option[B]
Checks if this map maps
key to a value and return the
value if it exists. |
def
|
iterator
: Iterator[(A, B)]
Returns an iterator over key-value pairs.
|
protected def
|
key : A |
protected def
|
next : ListMap[A, B] |
override def
|
size
: Int
Returns the number of mappings in this map.
|
override def
|
updated
[B1 >: B](key : A, value : B1) : ListMap[A, B1]
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. |
protected def
|
value : B |
| Methods inherited from Map | |
| withDefault, withDefaultValue |
| Methods inherited from MapLike | |
| ++, ++, transform, filterNot, update |
| Methods inherited from MapLike | |
| newBuilder, isEmpty, getOrElse, apply, contains, isDefinedAt, keySet, keysIterator, keys, valuesIterable, valuesIterator, values, default, filterKeys, mapValues, mapElements, addString, stringPrefix, toString, hashCode, equals |
| Methods inherited from Subtractable | |
| -, --, -- |
| Methods inherited from PartialFunction | |
| orElse, andThen |
| Methods inherited from Function1 | |
| compose |
| Methods inherited from Iterable | |
| companion |
| Methods inherited from IterableLike | |
| thisCollection, toCollection, elements, foreach, forall, exists, find, foldRight, reduceRight, toIterable, head, take, slice, takeWhile, takeRight, dropRight, copyToArray, zip, zipAll, zipWithIndex, sameElements, toStream, canEqual, view, view, first, firstOption, projection |
| Methods inherited from GenericTraversableTemplate | |
| genericBuilder, unzip, flatten, transpose |
| Methods inherited from TraversableLike | |
| repr, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, partialMap, remove, partition, groupBy, count, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, tail, last, lastOption, init, drop, dropWhile, span, splitAt, copyToBuffer, copyToArray, toArray, toList, toSeq, toIndexedSeq, toSet, mkString, mkString, mkString, addString, addString, withFilter |
| Methods inherited from AnyRef | |
| getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
| Methods inherited from Any | |
| ==, !=, isInstanceOf, asInstanceOf |
| Class Summary | |
protected class
|
Node
[B1 >: B](protected val override key : A, protected val override value : B1) extends ListMap[A, B1]
|
| Method Details |
override
def
size : Int
key to a value and return the
value if it exists.key - the key of the mapping of interestkey
to value. If the map contains already a
mapping for key, it will be overridden by this
function.key - the key element of the updated entry.value - the value element of the updated entry.kv - the key/value pairelem1 - the first element to add.elem2 - the second element to add.elems - the remaining elements to add.key.
If the map does not contain a mapping for the given key, the
method returns the same map.key - a map without a mapping for the given key.protected
def
key : A
protected
def
value : B
|
Scala Library
|
|