Package gnu.kawa.util
Class GeneralHashTable<K,V>
- All Implemented Interfaces:
Map<K,V>
- Direct Known Subclasses:
IdentityHashTable,LitTable,NamedCharTable,NameLookup
A generic hash table.
Supports deletions, and re-allocates the table when too big.
The equivalence relation can be customized.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields inherited from class gnu.kawa.util.AbstractHashTable
DEFAULT_INITIAL_SIZE, mask, num_bindings, table -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallocEntries(int n) Allocate Entry[n].protected intgetEntryHashCode(HashNode<K, V> entry) Extract hash-code from Entry.getEntryNext(HashNode<K, V> entry) Extract next Entry in same hash-bucket.This override helps Kawa type-inference - for example in srfi69.scm.Allocate a new node in the hash table.protected voidSet next Entry in same hash-bucket.Methods inherited from class gnu.kawa.util.AbstractHashTable
clear, entrySet, get, get, getOrDefault, hash, hashToIndex, matches, matches, put, put, rehash, remove, sizeMethods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
GeneralHashTable
public GeneralHashTable() -
GeneralHashTable
public GeneralHashTable(int capacity)
-
-
Method Details
-
getEntryHashCode
Description copied from class:AbstractHashTableExtract hash-code from Entry.- Specified by:
getEntryHashCodein classAbstractHashTable<HashNode<K,V>, K, V>
-
getEntryNext
Description copied from class:AbstractHashTableExtract next Entry in same hash-bucket.- Specified by:
getEntryNextin classAbstractHashTable<HashNode<K,V>, K, V>
-
setEntryNext
Description copied from class:AbstractHashTableSet next Entry in same hash-bucket.- Specified by:
setEntryNextin classAbstractHashTable<HashNode<K,V>, K, V>
-
allocEntries
Description copied from class:AbstractHashTableAllocate Entry[n].- Specified by:
allocEntriesin classAbstractHashTable<HashNode<K,V>, K, V>
-
makeEntry
Allocate a new node in the hash table. -
getNode
This override helps Kawa type-inference - for example in srfi69.scm.
-