Interface SimpleHashMap<K,V>

All Known Implementing Classes:
OpenHashTable

public interface SimpleHashMap<K,V>

A simplified interface for a map that forms the basis of a hash table implementation. The interface is generic in both the key and the associated value.


Method Summary
 V get(K key)
          Returns the value associated with the specified key.
 int getNumberOfKeys()
          Provides the number of keys in the map.
 boolean isEmpty()
          Returns true if this map contains no key-value mappings.
 V put(K key, V value)
          Associates the specified value with the specified key.
 V remove(K key)
          Removes the mapping for this key if it is present.
 

Method Detail

get

V get(K key)
Returns the value associated with the specified key.

Parameters:
key - the key being looked for
Returns:
the value associated with this key if found; otherwise, null

isEmpty

boolean isEmpty()
Returns true if this map contains no key-value mappings.

Returns:
returns true if there are no key-value mappings; otherwise, returns false

put

V put(K key,
      V value)
Associates the specified value with the specified key.

Parameters:
key - the key being looked for
value - the value to associate with this key if the key is found
Returns:
returns the previous value associated with the specified key, or null if there was no mapping for the key

remove

V remove(K key)
Removes the mapping for this key if it is present.

Parameters:
key - the key being looked for
Returns:
returns the previous value associated with the specified key, or null if there was no mapping for the key

getNumberOfKeys

int getNumberOfKeys()
Provides the number of keys in the map.

Returns:
returns the number of keys in the map