public abstract class Dictionary extends Object
Map
interface
in the Collections framework.Constructor and Description |
---|
Dictionary()
Sole constructor (often called implicitly).
|
Modifier and Type | Method and Description |
---|---|
abstract Enumeration |
elements()
Returns an Enumeration of the values in this Dictionary.
|
abstract Object |
get(Object key)
Returns the value associated with the supplied key, or null
if no such value exists.
|
abstract boolean |
isEmpty()
Returns true when there are no elements in this Dictionary.
|
abstract Enumeration |
keys()
Returns an Enumeration of the keys in this Dictionary
|
abstract Object |
put(Object key,
Object value)
Inserts a new value into this Dictionary, located by the
supplied key.
|
abstract Object |
remove(Object key)
Removes from the Dictionary the value located by the given key.
|
abstract int |
size()
Returns the number of values currently in this Dictionary.
|
public abstract Enumeration elements()
keys()
public abstract Object get(Object key)
key
- the key to use to fetch the valueNullPointerException
- if key is nullput(Object, Object)
public abstract boolean isEmpty()
size() == 0
public abstract Enumeration keys()
elements()
public abstract Object put(Object key, Object value)
key
- the key which locates the valuevalue
- the value to put into the DictionaryNullPointerException
- if key or value is nullget(Object)
public abstract Object remove(Object key)
key
- the key used to locate the value to be removedNullPointerException
- if key is nullpublic abstract int size()