Class TinyHash

java.lang.Object
  |
  +--TinyHash

public class TinyHash
extends java.lang.Object

A little hashtable implementation using an array of linked lists.

Since:
JDK1.2

Constructor Summary
TinyHash(int size)
          Creates a hashtable of specified size.
 
Method Summary
 boolean containsKey(java.lang.Object key)
          Tests if the specified object is a key in this hashtable.
 java.lang.Object get(java.lang.Object key)
          Returns the value to which the specified key is mapped in this hashtable.
 void put(java.lang.Object key, java.lang.Object value)
          Maps the specified key to the specified value in this hashtable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TinyHash

public TinyHash(int size)
Creates a hashtable of specified size.

Parameters:
size - - size of table
Method Detail

put

public void put(java.lang.Object key,
                java.lang.Object value)
Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null.

Parameters:
key - - the hashtable key
value - - the value

containsKey

public boolean containsKey(java.lang.Object key)
Tests if the specified object is a key in this hashtable.

Parameters:
key - - possible key
Returns:
true if and only if the specified object is a key in this hashtable, as determined by the equals method; false otherwise.

get

public java.lang.Object get(java.lang.Object key)
Returns the value to which the specified key is mapped in this hashtable.

Parameters:
key - - a key in the hashtable
Returns:
the value to which the key is mapped in this hashtable; null if the key is not mapped to any value in this hashtable.