Package gnu.kawa.util
Class WeakIdentityHashMap<K,V>
- All Implemented Interfaces:
Map<K,V>
-
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 TypeMethodDescriptionprotected WeakHashNode<K,V>[] allocEntries(int n) Allocate Entry[n].Find value for given key.protected intgetEntryHashCode(WeakHashNode<K, V> entry) Extract hash-code from Entry.protected WeakHashNode<K, V> getEntryNext(WeakHashNode<K, V> entry) Extract next Entry in same hash-bucket.intCalculate hash code of a key.protected WeakHashNode<K, V> Allocate a new node in the hash table.protected booleanCompare two keys for equivalence.protected voidsetEntryNext(WeakHashNode<K, V> entry, WeakHashNode<K, V> next) Set next Entry in same hash-bucket.Methods inherited from class gnu.kawa.util.AbstractHashTable
clear, entrySet, get, getNode, getOrDefault, hashToIndex, matches, put, rehash, 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
-
WeakIdentityHashMap
public WeakIdentityHashMap() -
WeakIdentityHashMap
public WeakIdentityHashMap(int capacity)
-
-
Method Details
-
getEntryHashCode
Description copied from class:AbstractHashTableExtract hash-code from Entry.- Specified by:
getEntryHashCodein classAbstractHashTable<WeakHashNode<K,V>, K, V>
-
getEntryNext
Description copied from class:AbstractHashTableExtract next Entry in same hash-bucket.- Specified by:
getEntryNextin classAbstractHashTable<WeakHashNode<K,V>, K, V>
-
setEntryNext
Description copied from class:AbstractHashTableSet next Entry in same hash-bucket.- Specified by:
setEntryNextin classAbstractHashTable<WeakHashNode<K,V>, K, V>
-
allocEntries
Description copied from class:AbstractHashTableAllocate Entry[n].- Specified by:
allocEntriesin classAbstractHashTable<WeakHashNode<K,V>, K, V>
-
hash
Description copied from class:AbstractHashTableCalculate hash code of a key.- Overrides:
hashin classAbstractHashTable<WeakHashNode<K,V>, K, V>
-
matches
Description copied from class:AbstractHashTableCompare two keys for equivalence. Override this and theAbstractHashTable.hash(Object)method if you want a different equivalence relation.- Overrides:
matchesin classAbstractHashTable<WeakHashNode<K,V>, K, V>
-
makeEntry
Description copied from class:AbstractHashTableAllocate a new node in the hash table.- Specified by:
makeEntryin classAbstractHashTable<WeakHashNode<K,V>, K, V>
-
get
Description copied from class:AbstractHashTableFind value for given key. Return defaultValue if not found.- Overrides:
getin classAbstractHashTable<WeakHashNode<K,V>, K, V>
-
put
- Overrides:
putin classAbstractHashTable<WeakHashNode<K,V>, K, V>
-
remove
-