Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.util

Class Dictionary

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


public abstract class Dictionary

extends Object

A Dictionary maps keys to values; how it does that is implementation-specific. This is an abstract class which has really gone by the wayside. People at Javasoft are probably embarrassed by it. At this point, it might as well be an interface rather than a class, but it remains this poor, laughable skeleton for the sake of backwards compatibility. At any rate, this was what came before the Map interface in the Collections framework.

Since:Authors:See Also:

Constructor Summary

Dictionary()

Sole constructor (often called implicitly).

Method Summary

java.util.Enumerationelements()

Returns an Enumeration of the values in this Dictionary.
java.lang.Objectget(java.lang.Object key)

Returns the value associated with the supplied key, or null if no such value exists.
booleanisEmpty()

Returns true when there are no elements in this Dictionary.
java.util.Enumerationkeys()

Returns an Enumeration of the keys in this Dictionary
java.lang.Objectput(java.lang.Object key, java.lang.Object value)

Inserts a new value into this Dictionary, located by the supplied key.
java.lang.Objectremove(java.lang.Object key)

Removes from the Dictionary the value located by the given key.
intsize()

Returns the number of values currently in this Dictionary.

Constructor Details

Dictionary

public Dictionary()

Sole constructor (often called implicitly).


Method Details

elements

public Enumeration elements()

Returns an Enumeration of the values in this Dictionary.

Returns:

See Also:


get

public Object get(java.lang.Object key)

Returns the value associated with the supplied key, or null if no such value exists. Since Dictionaries are not allowed null keys or elements, a null result always means the key is not present.

Parameters:

Returns:

Throws:

See Also:


isEmpty

public boolean isEmpty()

Returns true when there are no elements in this Dictionary.

Returns:


keys

public Enumeration keys()

Returns an Enumeration of the keys in this Dictionary

Returns:

See Also:


put

public Object put(java.lang.Object key, java.lang.Object value)

Inserts a new value into this Dictionary, located by the supplied key. Dictionary does not support null keys or values, so a null return can safely be interpreted as adding a new key.

Parameters:

Returns:

Throws:

See Also:


remove

public Object remove(java.lang.Object key)

Removes from the Dictionary the value located by the given key. A null return safely means that the key was not mapped in the Dictionary.

Parameters:

Returns:

Throws:


size

public int size()

Returns the number of values currently in this Dictionary.

Returns: