Scala Library
|
|
scala/collection/DefaultMap.scala
]
trait
DefaultMap[A, +B]
extends
Map[A, B]
A default map which implements the updated
and -
methods of maps.
Instances that inherit from DefaultMap[A, B]
still have to
define:
def get(key: A): Option[B] def iterator: Iterator[(A, B)]
It refers back to the original map.
It might also be advisable to override foreach
or
size
if efficient implementations can be found.
Method Summary | |
override def
|
+
[B1 >: B](kv : (A, B1)) : Map[A, B1]
A default implementation which creates a new immutable map.
|
override def
|
-
(key : A) : Map[A, B]
A default implementation which creates a new immutable map.
|
Methods inherited from Map | |
empty |
Methods inherited from MapLike | |
get (abstract), iterator (abstract), newBuilder, isEmpty, getOrElse, apply, contains, isDefinedAt, keySet, keysIterator, keys, valuesIterable, valuesIterator, values, default, filterKeys, mapValues, mapElements, updated, +, ++, ++, 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, size, 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, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
Scala Library
|
|