|
Scala Library
|
|
class
OpenHashMap[Key, Value](initialSize : Int)
extends Map[Key, Value]| Additional Constructor Summary | |
def
|
this : OpenHashMap[Key, Value] |
| Method Summary | |
def
|
+=
(kv : (Key, Value)) : OpenHashMap[Key, Value]
Add a new key/value mapping this map.
|
def
|
-=
(key : Key) : OpenHashMap[Key, Value]
Delete a key from this map if it is present.
|
override def
|
clone
: OpenHashMap[Key, Value]
This method creates and returns a copy of the receiver object.
|
override def
|
elements : Iterator[(Key, Value)] |
override def
|
empty : OpenHashMap[Key, Value] |
override def
|
foreach
[U](f : ((Key, Value)) => U) : Unit
Loop over the key, value mappings of this map.
The behaviour of modifying the map during an iteration is as follows:
|
def
|
get
(key : Key) : Option[Value]
Check if this map maps
key to a value and return the
value as an option if it exists, None if not. |
protected def
|
hashOf (key : Key) : Int |
def
|
iterator
: Iterator[(Key, Value)]
An iterator over the elements of this map. Use of this iterator follows the same
contract for concurrent modification as the foreach method.
|
override def
|
put
(key : Key, value : Value) : Option[Value]
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 : Key) : Option[Value]
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
|
retain
(f : (Key, Value) => Boolean) : OpenHashMap[Key, Value]
Retain only those mappings for which the predicate
p returns true. |
override def
|
size
: Int
The number of elements in this collection
|
override def
|
stringPrefix
: java.lang.String
Defines the prefix of this object's
toString representation.
!!! todo: remove stringPrefix overrides where possible |
override def
|
transform
(f : (Key, Value) => Value) : OpenHashMap[Key, Value]
This function transforms all the values of mappings contained
in this map with function
f. |
override def
|
update
(key : Key, value : Value) : Unit
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 MapLike | |
| newBuilder, updated, cached, +, +, ++, ++, -, removeKey, clear, getOrElseUpdate, 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, 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, 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 |
| Additional Constructor Details |
| Method Details |
override
def
empty : OpenHashMap[Key, Value]
override
def
size : Int
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 : (Key, Value)) : OpenHashMap[Key, Value]
kv - the key/value pair.
def
-=(key : Key) : OpenHashMap[Key, Value]
key - the key to be removedkey
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 removedkey to a value and return the
value as an option if it exists, None if not.key - the key of the mapping of interest.override
def
elements : Iterator[(Key, Value)]
override
def
clone : OpenHashMap[Key, Value]
The default implementation of the clone method is platform dependent.
f - The function to apply to each key, value mapping.f.f - The transformation to applyp returns true.p - The test predicateoverride
def
stringPrefix : java.lang.String
toString representation.
!!! todo: remove stringPrefix overrides where possible|
Scala Library
|
|