Scala Library
|
|
trait
DefaultMapModel[A, B]
extends
Map[A, B]Map
class in terms of three functions: findEntry
,
addEntry
, and entries
.Type Summary | |
type
|
Entry |
Method Summary | |
def
|
+=
(kv : (A, B)) : DefaultMapModel[A, B]
Add a new key/value mapping this map.
|
protected abstract def
|
addEntry (e : DefaultEntry) : Unit |
protected abstract def
|
entries : Iterator[DefaultEntry] |
protected abstract def
|
findEntry (key : A) : DefaultEntry |
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
|
put
(key : A, value : B) : Option[B]
Adds a new mapping from
key
to value to the map. If the map already contains a
mapping for key , it will be overridden. |
Methods inherited from Map | |
empty |
Methods inherited from Unhashable | |
hashCode, identityHashCode |
Methods inherited from MutableMapTemplate | |
-= (abstract), newBuilder, update, updated, cached, +, +, ++, ++, remove, -, removeKey, clear, getOrElseUpdate, transform, retain, clone, result, -, --, -- |
Methods inherited from Shrinkable | |
-=, --=, --= |
Methods inherited from Builder | |
sizeHint, mapResult |
Methods inherited from Growable | |
+=, ++=, ++= |
Methods inherited from MutableMapTemplateBase | |
+ |
Methods inherited from MapTemplate | |
isEmpty, getOrElse, apply, contains, isDefinedAt, keySet, keysIterator, keys, valueIterable, valuesIterator, values, default, filterKeys, mapValues, mapElements, +, ++, ++, addString, equals, stringPrefix, toString |
Methods inherited from PartialFunction | |
orElse, andThen |
Methods inherited from Function1 | |
compose |
Methods inherited from Iterable | |
companion |
Methods inherited from IterableTemplate | |
elements, foreach, foldRight, reduceRight, toIterable, head, takeRight, dropRight, sameElements, toStream, view, view, first, firstOption, toSeq, projection |
Methods inherited from TraversableClass | |
genericBuilder, unzip, flatten, transpose |
Methods inherited from TraversableTemplate | |
thisCollection, nonEmpty, size, hasDefiniteSize, ++, ++, map, flatMap, filter, filterMap, filterNot, remove, partition, groupBy, forall, exists, count, find, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, headOption, tail, last, lastOption, init, take, drop, slice, takeWhile, dropWhile, span, splitAt, copyToBuffer, copyToArray, copyToArray, toArray, toList, toSequence, toSet, mkString, mkString, mkString, addString, addString |
Methods inherited from AnyRef | |
getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Type Details |
Method Details |
protected abstract
def
findEntry(key : A) : DefaultEntry
protected abstract
def
addEntry(e : DefaultEntry) : Unit
protected abstract
def
entries : Iterator[DefaultEntry]
key
to a value and return the
value as an option if it exists, None if not.key -
the key of the mapping of interest.key
to value
to the map. If the map already contains a
mapping for key
, it will be overridden.key -
The key to updatevalue -
The new value
def
+=(kv : (A, B)) : DefaultMapModel[A, B]
kv -
the key/value pair.
Scala Library
|
|