|
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 | |
protected abstract def
|
addEntry (e : DefaultEntry) : Unit |
def
|
elements
: Iterator[(A, B)]
Creates a new iterator over all elements contained in this
object.
|
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 if it exists. |
def
|
update
(key : A, value : B) : Unit
This method allows one to add a new mapping from
key
to value to the map. If the map already contains a
mapping for key, it will be overridden by this
function. |
| Methods inherited from Map | |
| -= (abstract), +=, +=, ++=, ++=, +, +, ++, ++, -=, --=, --=, -, removeKey, put, -, --, --, clear, getOrElseUpdate, transform, retain, <<, clone, readOnly, +=, incl, excl |
| Methods inherited from Map | |
| size (abstract), getOrElse, isEmpty, apply, contains, isDefinedAt, keys, keySet, values, equals, hashCode, toString, default, projection, filterKeys, mapElements, stringPrefix |
| Methods inherited from Collection | |
| toArray |
| Methods inherited from Iterable | |
| concat, ++, map, flatMap, filter, partition, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toSeq, toStream, mkString, mkString, mkString, addString, addString, addString, copyToArray, hasDefiniteSize |
| Methods inherited from PartialFunction | |
| orElse, andThen |
| Methods inherited from Function1 | |
| compose |
| 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 if it exists.key - the key of the mapping of interestkey
to value to the map. If the map already contains a
mapping for key, it will be overridden by this
function.key - The key to updatevalue - The new value|
Scala Library
|
|