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.
java.util.Map
, java.lang.Object#equals(java.lang.Object)
, java.lang.Object#hashCode()
, java.util.Hashtable
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public abstract Enumeration | Returns: an enumeration of the values in this dictionary.Returns an enumeration of the values in this dictionary. |
public abstract V | |
public abstract boolean | Returns: true if this dictionary maps no keys to values;
false otherwise.Tests if this dictionary maps no keys to value. |
public abstract Enumeration | Returns: an enumeration of the keys in this dictionary.Returns an enumeration of the keys in this dictionary. |
public abstract V | Returns: the previous value to which thekey was mapped
in this dictionary, or null if the key did not
have a previous mapping.the hashtable key. key, V the value. value)Maps the specified |
public abstract V | |
public abstract int | Returns: the number of keys in this dictionary.Returns the number of entries (distinct keys) in this dictionary. |
Dictionary | back to summary |
---|---|
public Dictionary() Sole constructor. (For invocation by subclass constructors, typically implicit.) |
elements | back to summary |
---|---|
public abstract Enumeration Returns an enumeration of the values in this dictionary. The general
contract for the
|
get | back to summary |
---|---|
public abstract V get(Object key) Returns the value to which the key is mapped in this dictionary.
The general contract for the
|
isEmpty | back to summary |
---|---|
public abstract boolean isEmpty() Tests if this dictionary maps no keys to value. The general contract
for the
|
keys | back to summary |
---|---|
public abstract Enumeration Returns an enumeration of the keys in this dictionary. The general
contract for the keys method is that an
|
put | back to summary |
---|---|
public abstract V put(K key, V value) Maps the specified
If this dictionary already contains an entry for the specified
If this dictionary does not already have an entry
for the specified
The
|
remove | back to summary |
---|---|
public abstract V remove(Object key) Removes the
|
size | back to summary |
---|---|
public abstract int size() Returns the number of entries (distinct keys) in this dictionary.
|