ewe.util
Class Hashtable

java.lang.Object
  extended byewe.util.Hashtable
All Implemented Interfaces:
Map
Direct Known Subclasses:
Properties

public class Hashtable
extends Object
implements Map

A Hashtable is an implementation of a Map. This is a collection that associates Object values with Object keys. You search for an object in the Map by using the key.


Nested Class Summary
 
Nested classes inherited from class ewe.util.Map
Map.MapEntry
 
Constructor Summary
Hashtable()
          Constructs a new hashtable with the default initial capacity and a default load factor of 0.75
Hashtable(int initialCapacity)
          Constructs a new hashtable with the specified initial capacity and a default load factor of 0.75
Hashtable(int initialCapacity, float loadFactor)
          Constructs a hashtable with the specified initial capacity and the specified load factor.
 
Method Summary
 void clear()
          Remove all entries in the Map.
 boolean containsKey(Object key)
          Checks if an entry with the specified key is in the Map.
 boolean containsValue(Object value)
          Checks if at least one entry with the specified value is in the Map.
 Enumeration elements()
           
 Iterator entries()
          Provides an Iterator to iterate through all the entries.
 Object get(Object key)
          Get the object with the specified key.
 boolean isEmpty()
           
 Enumeration keys()
           
 Object put(Object key, Object value)
          Put the object and key in the Map.
protected  void rehash()
           
 Object remove(Object key)
          Remove the object and key pair from the Map.
 int size()
          Get the number of entries in the Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Constructor Detail

Hashtable

public Hashtable(int initialCapacity,
                 float loadFactor)
Constructs a hashtable with the specified initial capacity and the specified load factor.


Hashtable

public Hashtable(int initialCapacity)
Constructs a new hashtable with the specified initial capacity and a default load factor of 0.75


Hashtable

public Hashtable()
Constructs a new hashtable with the default initial capacity and a default load factor of 0.75

Method Detail

entries

public Iterator entries()
Description copied from interface: Map
Provides an Iterator to iterate through all the entries. Each object returned by the iterator will be a Map.MapEntry object.

Specified by:
entries in interface Map
Returns:
An Iterator to iterate through all the entries.

size

public int size()
Description copied from interface: Map
Get the number of entries in the Map.

Specified by:
size in interface Map
Returns:
The number of entries in the Map.

isEmpty

public boolean isEmpty()

containsValue

public boolean containsValue(Object value)
Description copied from interface: Map
Checks if at least one entry with the specified value is in the Map.

Specified by:
containsValue in interface Map
Parameters:
value - The value to look for.
Returns:
true if the value is in the Map at least once.

containsKey

public boolean containsKey(Object key)
Description copied from interface: Map
Checks if an entry with the specified key is in the Map.

Specified by:
containsKey in interface Map
Parameters:
key - The key to look for.
Returns:
true if the key is in the Map.

remove

public Object remove(Object key)
Description copied from interface: Map
Remove the object and key pair from the Map.

Specified by:
remove in interface Map
Parameters:
key - The key for the Object to replace.
Returns:
The value for the key that was removed if it was in the Map.

put

public Object put(Object key,
                  Object value)
Description copied from interface: Map
Put the object and key in the Map. Any old entry with the same key will be replaced.

Specified by:
put in interface Map
Parameters:
key - The key for the object.
value - The object to put
Returns:
The same as value.

clear

public void clear()
Description copied from interface: Map
Remove all entries in the Map.

Specified by:
clear in interface Map

get

public Object get(Object key)
Description copied from interface: Map
Get the object with the specified key.

Specified by:
get in interface Map
Parameters:
key - The key to look for.
Returns:
The object associated with the key or null if there is no matching key.

rehash

protected void rehash()

elements

public Enumeration elements()

keys

public Enumeration keys()