27
28 /**
29 * The <code>Dictionary</code> class is the abstract parent of any
30 * class, such as <code>Hashtable</code>, which maps keys to values.
31 * Every key and every value is an object. In any one <tt>Dictionary</tt>
32 * object, every key is associated with at most one value. Given a
33 * <tt>Dictionary</tt> and a key, the associated element can be looked up.
34 * Any non-<code>null</code> object can be used as a key and as a value.
35 * <p>
36 * As a rule, the <code>equals</code> method should be used by
37 * implementations of this class to decide if two keys are the same.
38 * <p>
39 * <strong>NOTE: This class is obsolete. New implementations should
40 * implement the Map interface, rather than extending this class.</strong>
41 *
42 * @author unascribed
43 * @see java.util.Map
44 * @see java.lang.Object#equals(java.lang.Object)
45 * @see java.lang.Object#hashCode()
46 * @see java.util.Hashtable
47 * @since JDK1.0
48 */
49 public abstract
50 class Dictionary<K,V> {
51 /**
52 * Sole constructor. (For invocation by subclass constructors, typically
53 * implicit.)
54 */
55 public Dictionary() {
56 }
57
58 /**
59 * Returns the number of entries (distinct keys) in this dictionary.
60 *
61 * @return the number of keys in this dictionary.
62 */
63 abstract public int size();
64
65 /**
66 * Tests if this dictionary maps no keys to value. The general contract
67 * for the <tt>isEmpty</tt> method is that the result is true if and only
|
27
28 /**
29 * The <code>Dictionary</code> class is the abstract parent of any
30 * class, such as <code>Hashtable</code>, which maps keys to values.
31 * Every key and every value is an object. In any one <tt>Dictionary</tt>
32 * object, every key is associated with at most one value. Given a
33 * <tt>Dictionary</tt> and a key, the associated element can be looked up.
34 * Any non-<code>null</code> object can be used as a key and as a value.
35 * <p>
36 * As a rule, the <code>equals</code> method should be used by
37 * implementations of this class to decide if two keys are the same.
38 * <p>
39 * <strong>NOTE: This class is obsolete. New implementations should
40 * implement the Map interface, rather than extending this class.</strong>
41 *
42 * @author unascribed
43 * @see java.util.Map
44 * @see java.lang.Object#equals(java.lang.Object)
45 * @see java.lang.Object#hashCode()
46 * @see java.util.Hashtable
47 * @since 1.0
48 */
49 public abstract
50 class Dictionary<K,V> {
51 /**
52 * Sole constructor. (For invocation by subclass constructors, typically
53 * implicit.)
54 */
55 public Dictionary() {
56 }
57
58 /**
59 * Returns the number of entries (distinct keys) in this dictionary.
60 *
61 * @return the number of keys in this dictionary.
62 */
63 abstract public int size();
64
65 /**
66 * Tests if this dictionary maps no keys to value. The general contract
67 * for the <tt>isEmpty</tt> method is that the result is true if and only
|