Package gnu.kawa.util
Class IdentityHashTable<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- gnu.kawa.util.AbstractHashTable<HashNode<K,V>,K,V>
-
- gnu.kawa.util.GeneralHashTable<K,V>
-
- gnu.kawa.util.IdentityHashTable<K,V>
-
- All Implemented Interfaces:
Map<K,V>
public class IdentityHashTable<K,V> extends GeneralHashTable<K,V>
A hash table where "equals" is object identity.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
-
Fields inherited from class gnu.kawa.util.AbstractHashTable
DEFAULT_INITIAL_SIZE, mask, num_bindings, table
-
-
Constructor Summary
Constructors Constructor Description IdentityHashTable()
IdentityHashTable(int capacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
hash(Object key)
Calculate hash code of a key.boolean
matches(K value1, Object value2)
Compare two keys for equivalence.-
Methods inherited from class gnu.kawa.util.GeneralHashTable
allocEntries, getEntryHashCode, getEntryNext, getNode, makeEntry, setEntryNext
-
Methods inherited from class gnu.kawa.util.AbstractHashTable
clear, entrySet, get, get, getOrDefault, hashToIndex, matches, put, put, rehash, remove, 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
-
-
-
-
Method Detail
-
hash
public int hash(Object key)
Description copied from class:AbstractHashTable
Calculate hash code of a key.
-
matches
public boolean matches(K value1, Object value2)
Description copied from class:AbstractHashTable
Compare two keys for equivalence. Override this and theAbstractHashTable.hash(Object)
method if you want a different equivalence relation.
-
-