The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to values. Every key and every value is an object. In any one Dictionary object, every key is associated with at most one value. Given a Dictionary and a key, the associated element can be looked up. 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.

NOTE: This class is obsolete. New implementations should implement the Map interface, rather than extending this class.

Author

unascribed

See

  • java.util.Map
  • java.lang.Object#equals(java.lang.Object)
  • java.lang.Object#hashCode()
  • java.util.Hashtable

Since

1.0

Type Parameters

  • K
  • V

Constructors

Methods

Constructors

Methods

  • Returns the value to which the key is mapped in this dictionary. The general contract for the isEmpty method is that if this dictionary contains an entry for the specified key, the associated value is returned; otherwise, null is returned.

    Parameters

    • key: any

      a key in this dictionary. null if the key is not mapped to any value in this dictionary.

    Returns V

    the value to which the key is mapped in this dictionary;

    Exception

    NullPointerException if the key is null.

    See

    java.util.Dictionary#put(java.lang.Object, java.lang.Object)

  • Tests if this dictionary maps no keys to value. The general contract for the isEmpty method is that the result is true if and only if this dictionary contains no entries.

    Returns boolean

    true if this dictionary maps no keys to values; false otherwise.