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:
- java.util.Map<K,V>
public class IdentityHashTable<K,V>
- extends GeneralHashTable<K,V>
A hash table where "equals" is object identity.
Nested classes/interfaces inherited from class java.util.AbstractMap |
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry<K,V> |
Method Summary |
int |
hash(java.lang.Object key)
Calculate hash code of a key. |
boolean |
matches(K value1,
java.lang.Object value2)
Compare two keys for equivalence. |
Methods inherited from class gnu.kawa.util.AbstractHashTable |
clear, entrySet, get, get, 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 |
IdentityHashTable
public IdentityHashTable()
IdentityHashTable
public IdentityHashTable(int capacity)
hash
public int hash(java.lang.Object key)
- Description copied from class:
AbstractHashTable
- Calculate hash code of a key.
- Overrides:
hash
in class AbstractHashTable<HashNode<K,V>,K,V>
matches
public boolean matches(K value1,
java.lang.Object value2)
- Description copied from class:
AbstractHashTable
- Compare two keys for equivalence.
Override this and the
AbstractHashTable.hash(Object)
method if you want
a different equivalence relation.
- Overrides:
matches
in class AbstractHashTable<HashNode<K,V>,K,V>