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 int
getEntryHashCode
(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.int
Calculate hash code of a key.protected WeakHashNode
<K, V> Allocate a new node in the hash table.protected boolean
Compare two keys for equivalence.protected void
setEntryNext
(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, size
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:AbstractHashTable
Extract hash-code from Entry.- Specified by:
getEntryHashCode
in classAbstractHashTable<WeakHashNode<K,
V>, K, V>
-
getEntryNext
Description copied from class:AbstractHashTable
Extract next Entry in same hash-bucket.- Specified by:
getEntryNext
in classAbstractHashTable<WeakHashNode<K,
V>, K, V>
-
setEntryNext
Description copied from class:AbstractHashTable
Set next Entry in same hash-bucket.- Specified by:
setEntryNext
in classAbstractHashTable<WeakHashNode<K,
V>, K, V>
-
allocEntries
Description copied from class:AbstractHashTable
Allocate Entry[n].- Specified by:
allocEntries
in classAbstractHashTable<WeakHashNode<K,
V>, K, V>
-
hash
Description copied from class:AbstractHashTable
Calculate hash code of a key.- Overrides:
hash
in classAbstractHashTable<WeakHashNode<K,
V>, K, V>
-
matches
Description copied from class:AbstractHashTable
Compare two keys for equivalence. Override this and theAbstractHashTable.hash(Object)
method if you want a different equivalence relation.- Overrides:
matches
in classAbstractHashTable<WeakHashNode<K,
V>, K, V>
-
makeEntry
Description copied from class:AbstractHashTable
Allocate a new node in the hash table.- Specified by:
makeEntry
in classAbstractHashTable<WeakHashNode<K,
V>, K, V>
-
get
Description copied from class:AbstractHashTable
Find value for given key. Return defaultValue if not found.- Overrides:
get
in classAbstractHashTable<WeakHashNode<K,
V>, K, V>
-
put
- Overrides:
put
in classAbstractHashTable<WeakHashNode<K,
V>, K, V>
-
remove
-