Scala Library
|
|
scala/collection/mutable/HashTable.scala
]
trait
HashTable[A]
extends
AnyRefHashTable[A]
implements a hashtable
that maps keys of type A
to values of the fully abstract
member type Entry
. Classes that make use of HashTable
have to provide an implementation for Entry
There are mainly two parameters that affect the performance of a hashtable:
the initial size and the load factor. The size
refers to the number of buckets in the hashtable, and the load
factor is a measure of how full the hashtable is allowed to get before
its size is automatically doubled. Both parameters may be changed by
overriding the corresponding values in class HashTable
.Type Summary | |
protected abstract type
|
Entry <: HashEntry[A, Entry] >: Null |
Value Summary | |
protected final val
|
loadFactorDenum : Int = 1000 |
protected var
|
table
: Array[HashEntry[A, Entry]]
The actual hash table.
|
protected var
|
tableSize
: Int
The number of mappings contained in this hash table.
|
protected var
|
threshold
: Int
The next size value at which to resize (capacity load factor).
|
Method Summary | |
protected def
|
addEntry (e : Entry) : Unit |
def
|
clear : Unit |
protected def
|
elemEquals (key1 : A, key2 : A) : Boolean |
protected def
|
elemHashCode (key : A) : Int |
protected def
|
entries : Iterator[Entry] |
protected def
|
findEntry (key : A) : Entry |
protected final def
|
improve (hcode : Int) : Int |
protected final def
|
index (hcode : Int) : Int |
protected def
|
initialSize
: Int
The initial size of the hash table.
|
protected def
|
initialThreshold
: Int
The initial threshold
|
protected def
|
loadFactor
: Int
The load factor for the hash table (in 0.001 step).
|
protected def
|
removeEntry (key : A) : Option[Entry] |
def
|
size
: Int
Returns the size of this hash table.
|
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Type Details |
Value Details |
protected final
val
loadFactorDenum : Int
protected
var
tableSize : Int
protected
var
threshold : Int
Method Details |
protected
def
loadFactor : Int
protected
def
initialSize : Int
protected
def
initialThreshold : Int
def
size : Int
def
clear : Unit
Scala Library
|
|