gnu.kawa.util
Class IdentityHashTable<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by gnu.kawa.util.AbstractHashTable<HashNode<K,V>,K,V>
          extended by gnu.kawa.util.GeneralHashTable<K,V>
              extended by 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 Class Summary
 
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>
 
Field Summary
 
Fields inherited from class gnu.kawa.util.AbstractHashTable
DEFAULT_INITIAL_SIZE, mask, num_bindings, table
 
Constructor Summary
IdentityHashTable()
           
IdentityHashTable(int capacity)
           
 
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.GeneralHashTable
allocEntries, getEntryHashCode, getEntryNext, getNode, makeEntry, setEntryNext
 
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
 

Constructor Detail

IdentityHashTable

public IdentityHashTable()

IdentityHashTable

public IdentityHashTable(int capacity)
Method Detail

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>