Class java.util.Dictionary
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.util.Dictionary

java.lang.Object
   |
   +----java.util.Dictionary

public class Dictionary
extends Object
The Dictionary class is the abstract parent of Hashtable, which maps keys to values. Any object can be used as a key and/or value.
See Also:
Hashtable, hashCode, equals

Constructor Index

 o Dictionary()

Method Index

 o elements()
Returns an enumeration of the elements.
 o get(Object)
Gets the object associated with the specified key in the Dictionary.
 o isEmpty()
Returns true if the Dictionary contains no elements.
 o keys()
Returns an enumeration of the Dictionary's keys.
 o put(Object, Object)
Puts the specified element into the Dictionary, using the specified key.
 o remove(Object)
Removes the element corresponding to the key.
 o size()
Returns the number of elements contained within the Dictionary.

Constructors

 o Dictionary
  public Dictionary()

Methods

 o size
  public abstract int size()
Returns the number of elements contained within the Dictionary.
 o isEmpty
  public abstract boolean isEmpty()
Returns true if the Dictionary contains no elements.
 o keys
  public abstract Enumeration keys()
Returns an enumeration of the Dictionary's keys.
See Also:
elements, Enumeration
 o elements
  public abstract Enumeration elements()
Returns an enumeration of the elements. Use the Enumeration methods on the returned object to fetch the elements sequentially.
See Also:
keys, Enumeration
 o get
  public abstract Object get(Object key)
Gets the object associated with the specified key in the Dictionary.
Parameters:
key - the key in the hash table
Returns:
s the element for the key or null if the key is not defined in the hash table.
See Also:
put
 o put
  public abstract Object put(Object key,
                             Object value)
Puts the specified element into the Dictionary, using the specified key. The element may be retrieved by doing a get() with the same key. The key and the element cannot be null.
Parameters:
key - the specified hashtable key
value - the specified element
Returns:
the old value of the key, or null if it did not have one.
Throws: NullPointerException
If the value of the specified element is null.
See Also:
get
 o remove
  public abstract Object remove(Object key)
Removes the element corresponding to the key. Does nothing if the key is not present.
Parameters:
key - the key that needs to be removed
Returns:
the value of key, or null if the key was not found.

All Packages  Class Hierarchy  This Package  Previous  Next  Index