|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary<K,V>
public abstract class Dictionary<K,V>
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.
Map
,
Hashtable
Constructor Summary | |
---|---|
Dictionary()
Sole constructor (often called implicitly). |
Method Summary | |
---|---|
abstract Enumeration<V> |
elements()
Returns an Enumeration of the values in this Dictionary. |
abstract V |
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<K> |
keys()
Returns an Enumeration of the keys in this Dictionary |
abstract V |
put(K key,
V value)
Inserts a new value into this Dictionary, located by the supplied key. |
abstract V |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Dictionary()
Method Detail |
---|
public abstract Enumeration<V> elements()
keys()
public abstract V get(Object key)
key
- the key to use to fetch the value
NullPointerException
- if key is nullput(Object, Object)
public abstract boolean isEmpty()
size() == 0
public abstract Enumeration<K> keys()
elements()
public abstract V put(K key, V value)
key
- the key which locates the valuevalue
- the value to put into the Dictionary
NullPointerException
- if key or value is nullget(Object)
public abstract V remove(Object key)
key
- the key used to locate the value to be removed
NullPointerException
- if key is nullpublic abstract int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |