Build 1.0_r1(from source)

java.util
Class Dictionary<K,V>

java.lang.Object
  extended by java.util.Dictionary<K,V>
Direct Known Subclasses:
Hashtable

public abstract class Dictionary<K,V>
extends Object

Dictionary is a abstract class which is the superclass of all classes that associate keys with values, such as Hashtable.

Since:
1.0
See Also:
Hashtable

Constructor Summary
Dictionary()
          Constructs a new instance of this class.
 
Method Summary
abstract  Enumeration<V> elements()
          Returns an Enumeration on the elements of this Dictionary.
abstract  V get(Object key)
          Returns the value associated with key.
abstract  boolean isEmpty()
          Returns if this Dictionary has no key/value pairs, a size of zero.
abstract  Enumeration<K> keys()
          Returns an Enumeration on the keys of this Dictionary.
abstract  V put(K key, V value)
          Associate key with value in this Dictionary.
abstract  V remove(Object key)
          Remove the key/value pair with the specified key from this Dictionary.
abstract  int size()
          Returns the number of key/value pairs in this Dictionary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dictionary

public Dictionary()
Constructs a new instance of this class.

Method Detail

elements

public abstract Enumeration<V> elements()
Returns an Enumeration on the elements of this Dictionary.

Returns:
an Enumeration of the values of this Dictionary
See Also:
keys(), size(), Enumeration

get

public abstract V get(Object key)
Returns the value associated with key.

Parameters:
key - the key of the value returned
Returns:
the value associated with key or null if the specified key does not exist
See Also:
put(K, V)

isEmpty

public abstract boolean isEmpty()
Returns if this Dictionary has no key/value pairs, a size of zero.

Returns:
true if this Dictionary has no key/value pairs, false otherwise
See Also:
size()

keys

public abstract Enumeration<K> keys()
Returns an Enumeration on the keys of this Dictionary.

Returns:
an Enumeration of the keys of this Dictionary
See Also:
elements(), size(), Enumeration

put

public abstract V put(K key,
                      V value)
Associate key with value in this Dictionary. If key exists in the Dictionary prior to this call being made, the old value is replaced.

Parameters:
key - the key to add
value - the value to add
Returns:
the old value previously associated with key or null if key is new to the Dictionary.
See Also:
elements(), get(java.lang.Object), keys()

remove

public abstract V remove(Object key)
Remove the key/value pair with the specified key from this Dictionary.

Parameters:
key - the key to remove
Returns:
the associated value or else null if key is not known to this Dictionary
See Also:
get(java.lang.Object), put(K, V)

size

public abstract int size()
Returns the number of key/value pairs in this Dictionary.

Returns:
the number of key/value pairs in this Dictionary
See Also:
elements(), keys()

Build 1.0_r1(from source)

Please submit a feedback, bug or feature