GenericHashMap

dotty.tools.dotc.util.GenericHashMap
See theGenericHashMap companion object
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.

Attributes

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
Graph
Supertypes
class MutableMap[Key, Value]
class ReadOnlyMap[Key, Value]
class Object
trait Matchable
class Any
Known subtypes
class EqHashMap[Key, Value]
class HashMap[Key, Value]

Members list

Concise view

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

Attributes

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

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

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

Inherited methods

def -=(k: Key): MutableMap.this.type

Attributes

Inherited from:
MutableMap
def apply(key: Key): Value

Attributes

Inherited from:
ReadOnlyMap
def contains(key: Key): Boolean

Attributes

Inherited from:
ReadOnlyMap
def get(key: Key): Option[Value]

Attributes

Inherited from:
ReadOnlyMap
def getOrElse(key: Key, value: => Value): Value

Attributes

Inherited from:
ReadOnlyMap

Attributes

Inherited from:
ReadOnlyMap
def toArray: Array[(Key, Value)]

Attributes

Inherited from:
ReadOnlyMap
def toSeq: Seq[(Key, Value)]

Attributes

Inherited from:
ReadOnlyMap