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 any class, such as Hashtable, which maps keys to values. Any non-null object can be used as a key and as a value.

As a rule, the equals method should be used by implementations of this class to decide if two keys are the same.

See Also:
equals, hashCode, Hashtable

Constructor Index

 o Dictionary()

Method Index

 o elements()
Returns an enumeration of the values in this dictionary.
 o get(Object)
Returns the value to which the key is mapped in this dictionary.
 o isEmpty()
Tests if this dictionary maps no keys to value.
 o keys()
Returns an enumeration of the keys in this dictionary.
 o put(Object, Object)
Maps the specified key to the specified value in this dictionary.
 o remove(Object)
Removes the key (and its corresponding value) from this dictionary.
 o size()
Returns the number of keys in this dictionary.

Constructors

 o Dictionary
    method Dictionary() public 

Methods

 o size
    method size() returns int public abstract    
Returns the number of keys in this dictionary.

Returns:
the number of keys in this dictionary.
 o isEmpty
    method isEmpty() returns boolean public abstract    
Tests if this dictionary maps no keys to value.

Returns:
true if this dictionary maps no keys to values; false otherwise.
 o keys
    method keys() returns Enumeration public abstract    
Returns an enumeration of the keys in this dictionary.

Returns:
an enumeration of the keys in this dictionary.
See Also:
elements, Enumeration
 o elements
    method elements() returns Enumeration public abstract    
Returns an enumeration of the values in this dictionary. the Enumeration methods on the returned object to fetch the elements sequentially.

Returns:
an enumeration of the values in this dictionary.
See Also:
keys, Enumeration
 o get
    method get(key=Object) returns Object public abstract    
Returns the value to which the key is mapped in this dictionary.

Parameters:
key - a key in this dictionary. null if the key is not mapped to any value in this dictionary.
Returns:
the value to which the key is mapped in this dictionary;
See Also:
put
 o put
    method put(key=Object, -
               value=Object) returns Object public abstract    
Maps the specified key to the specified value in this dictionary. Neither the key nor the value can be null.

The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters:
key - the hashtable key.
value - the value.
Returns:
the previous value to which the key was mapped in this dictionary, or null if the key did not have a previous mapping.
Throws: NullPointerException
if the key or value is null.
See Also:
equals, get
 o remove
    method remove(key=Object) returns Object public abstract    
Removes the key (and its corresponding value) from this dictionary. This method does nothing if the key is not in this dictionary.

Parameters:
key - the key that needs to be removed.
Returns:
the value to which the key had been mapped in this dictionary, or null if the key did not have a mapping.

All Packages  Class Hierarchy  This Package  Previous  Next  Index