GenericHashMap

abstract class GenericHashMap[Key, Value](initialCapacity: Int, capacityMultiple: Int) extends MutableMap[Key, Value]

A hash table using open hashing with linear scan which is also very space efficient at small sizes. The implementations of hash and isEqual are left open. They have to be provided by subclasses.

Value parameters:
capacityMultiple

The minimum multiple of capacity relative to used elements. The hash table will be re-sized once the number of elements multiplied by capacityMultiple exceeds the current size of the hash table. However, a table of size up to DenseLimit will be re-sized only once the number of elements reaches the table's size.

initialCapacity

Indicates the initial number of slots in the hash table. The actual number of slots is always a power of 2, so the initial size of the table will be the smallest power of two that is equal or greater than the given initialCapacity. Minimum value is 4.

Companion:
object
class MutableMap[Key, Value]
class ReadOnlyMap[Key, Value]
class Object
trait Matchable
class Any
class EqHashMap[Key, Value]
class HashMap[Key, Value]

Value members

Concrete methods

def clear(): Unit

Remove all elements from this table and set back to initial configuration

Remove all elements from this table and set back to initial configuration

def copyFrom(oldTable: Array[AnyRef | Null]): Unit
def getOrElseUpdate(key: Key, value: => Value): Value
def iterator: Iterator[(Key, Value)]
def lookup(key: Key): Value | Null
def remove(key: Key): Value | Null
def size: Int

The number of elements in the set

The number of elements in the set

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Returns:

a string representation of the object.

Definition Classes
Any
def update(key: Key, value: Value): Unit

Inherited methods

def -=(k: Key): GenericHashMap[Key, Value]
Inherited from:
MutableMap
def apply(key: Key): Value
Inherited from:
ReadOnlyMap
def contains(key: Key): Boolean
Inherited from:
ReadOnlyMap
def get(key: Key): Option[Value]
Inherited from:
ReadOnlyMap
def getOrElse(key: Key, value: => Value): Value
Inherited from:
ReadOnlyMap
Inherited from:
ReadOnlyMap
def toArray: Array[(Key, Value)]
Inherited from:
ReadOnlyMap
def toSeq: Seq[(Key, Value)]
Inherited from:
ReadOnlyMap