Class HashMap
Defined in: hashmap.js.
Constructor Attributes | Constructor Name and Description |
---|---|
HashMap(compareFunc, hashFunc, initialCapacity, loadFactor)
Hash Map
|
Method Attributes | Method Name and Description |
---|---|
<inner> |
addEntry(hash, key, value, bucketIndex)
|
<inner> |
clear()
|
containsKey(key)
|
|
<inner> |
Entry(hash, key, value, next)
|
<inner> |
get(key)
|
<inner> |
getEntry(key)
|
<inner> | |
<static> |
HashMap.hash(h)
Applies a supplemental hash function to a given hashcode, which defends
against poor quality hash functions.
|
<static> |
HashMap.indexFor(h, length)
Return index for hash code h
|
<inner> |
isEmpty()
|
put(key, value)
|
|
<inner> |
putForNullKey(value)
|
remove(key)
|
|
<inner> |
removeEntryForKey(key)
|
<inner> |
resize(newCapacity)
|
<inner> |
size()
|
<inner> |
transfer(newTable)
|
Class Detail
HashMap(compareFunc, hashFunc, initialCapacity, loadFactor)
Hash Map
Author: Sijie Guo.
Author: Sijie Guo
- Parameters:
- {Function} compareFunc
- function used for comparasion
- {Function} hashFunc
- function used to compute hash value
- {Number} initialCapacity
- initial map capacity
- {Number} loadFactor
- load factor
Method Detail
<inner>
addEntry(hash, key, value, bucketIndex)
- Parameters:
- hash
- key
- value
- bucketIndex
<inner>
clear()
containsKey(key)
- Parameters:
- key
<inner>
Entry(hash, key, value, next)
- Parameters:
- hash
- key
- value
- next
<inner>
get(key)
- Parameters:
- key
<inner>
getEntry(key)
- Parameters:
- key
<inner>
getForNullKey()
<static>
HashMap.hash(h)
Applies a supplemental hash function to a given hashcode, which defends
against poor quality hash functions.
- Parameters:
- {Number} h
- a given hash code
- Returns:
- hash value
<static>
HashMap.indexFor(h, length)
Return index for hash code h
- Parameters:
- {Number} h
- a given hash code
- {Number} length
- length of current size
- Returns:
- index
<inner>
isEmpty()
put(key, value)
- Parameters:
- key
- value
<inner>
putForNullKey(value)
- Parameters:
- value
remove(key)
- Parameters:
- key
<inner>
removeEntryForKey(key)
- Parameters:
- key
<inner>
resize(newCapacity)
- Parameters:
- newCapacity
<inner>
size()
<inner>
transfer(newTable)
- Parameters:
- newTable