scala.collection.mutable

class ListMap

[source: scala/collection/mutable/ListMap.scala]

@serializable

class ListMap[A, B]
extends Map[A, B] with MapLike[A, B, ListMap[A, B]]
Since
2.8
Method Summary
def += (kv : (A, B)) : ListMap[A, B]
Add a new key/value mapping this map.
def -= (key : A) : ListMap[A, B]
Delete a key from this map if it is present.
override def clear : Unit
Removes all elements from the set. After this operation is completed, the set will be empty.
override def empty : ListMap[A, B]
def get (key : A) : Option[B]
Check if this map maps key to a value and return the value as an option if it exists, None if not.
def iterator : Iterator[(A, B)]
An iterator yielding all key/value mappings of this map.
override def size : Int
The number of elements in this collection
Methods inherited from MapLike
newBuilder, put, update, updated, cached, +, +, ++, ++, remove, -, removeKey, getOrElseUpdate, transform, retain, clone, result, -, --, --
Methods inherited from Shrinkable
-=, --=, --=
Methods inherited from Builder
sizeHint, mapResult
Methods inherited from Growable
+=, ++=, ++=
Methods inherited from MapLikeBase
+
Methods inherited from MapLike
isEmpty, getOrElse, apply, contains, isDefinedAt, keySet, keysIterator, keys, valuesIterable, valuesIterator, values, default, filterKeys, mapValues, mapElements, +, ++, ++, addString, stringPrefix, toString, hashCode, equals
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, filterNot, 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, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
override def empty : ListMap[A, B]
Overrides
Map.empty

def get(key : A) : Option[B]
Check if this map maps key to a value and return the value as an option if it exists, None if not.
Parameters
key - the key of the mapping of interest.
Returns
the value of the mapping as an option, if it exists, or None.

def iterator : Iterator[(A, B)]
An iterator yielding all key/value mappings of this map.

def +=(kv : (A, B)) : ListMap[A, B]
Add a new key/value mapping this map.
Parameters
kv - the key/value pair.
Returns
the map itself
Overrides
MapLike.+=

def -=(key : A) : ListMap[A, B]
Delete a key from this map if it is present.
Parameters
key - the key to be removed
Notes
same as `delete`.
Overrides
MapLike.-=

override def clear : Unit
Removes all elements from the set. After this operation is completed, the set will be empty.
Overrides
MapLike.clear

override def size : Int
The number of elements in this collection