Scala Library
|
|
class
LinkedHashMap[A, B]
extends
Map[A, B] with
MutableMapTemplate[A, B, LinkedHashMap[A, B]] with
HashTable[A]Type Summary | |
type
|
Entry |
Value Summary | |
protected var
|
firstEntry : LinkedEntry |
protected var
|
lastEntry : LinkedEntry |
Values and Variables inherited from HashTable | |
loadFactorDenum, table, tableSize, threshold |
Method Summary | |
def
|
+=
(kv : (A, B)) : LinkedHashMap[A, B]
Add a new key/value mapping this map.
|
def
|
-=
(key : A) : LinkedHashMap[A, B]
Delete a key from this map if it is present.
|
override def
|
clear
: Unit
Remove all entries from table
|
override def
|
empty : LinkedHashMap[A, B] |
override def
|
foreach
[U](f : ((A, B)) => U) : Unit
Apply a function
f to all elements of this
traversable object. |
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
|
keysIterator
: Iterator[A]
Creates an iterator for all keys.
|
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. |
override def
|
remove
(key : A) : Option[B]
If given key is defined in this map, remove it and return associated value as an Option.
If key is not present return None.
|
override def
|
size
: Int
Returns the size of this hash table.
|
override def
|
valuesIterator
: Iterator[B]
Creates an iterator for a contained values.
|
Methods inherited from HashTable | |
loadFactor, initialSize, initialThreshold, findEntry, addEntry, removeEntry, entriesIterator, entries, elemEquals, elemHashCode, improve, index |
Methods inherited from Unhashable | |
hashCode, identityHashCode |
Methods inherited from MutableMapTemplate | |
newBuilder, update, updated, cached, +, +, ++, ++, -, removeKey, 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, keys, valueIterable, 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, 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, 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 |
Value Details |
Method Details |
override
def
empty : LinkedHashMap[A, B]
override
def
size : Int
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 valuekey -
the key to be removed
def
+=(kv : (A, B)) : LinkedHashMap[A, B]
kv -
the key/value pair.
def
-=(key : A) : LinkedHashMap[A, B]
key -
the key to be removedf
to all elements of this
traversable object.f -
A function that is applied for its side-effect to every element. The result (of arbitrary type U) of function `f` is discarded.override
def
clear : Unit
Scala Library
|
|