1 |
/* Dictionary.java -- an abstract (and essentially worthless) |
/* Dictionary.java -- an abstract (and essentially worthless) |
2 |
class which is Hashtable's superclass |
class which is Hashtable's superclass |
3 |
Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. |
Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
6 |
|
|
57 |
* @since 1.0 |
* @since 1.0 |
58 |
* @status updated to 1.4 |
* @status updated to 1.4 |
59 |
*/ |
*/ |
60 |
public abstract class Dictionary |
public abstract class Dictionary<K, V> |
61 |
{ |
{ |
62 |
// WARNING: Dictionary is a CORE class in the bootstrap cycle. See the |
// WARNING: Dictionary is a CORE class in the bootstrap cycle. See the |
63 |
// comments in vm/reference/java/lang/Runtime for implications of this fact. |
// comments in vm/reference/java/lang/Runtime for implications of this fact. |
75 |
* @return an Enumeration of the values |
* @return an Enumeration of the values |
76 |
* @see #keys() |
* @see #keys() |
77 |
*/ |
*/ |
78 |
public abstract Enumeration elements(); |
public abstract Enumeration<V> elements(); |
79 |
|
|
80 |
/** |
/** |
81 |
* Returns the value associated with the supplied key, or null |
* Returns the value associated with the supplied key, or null |
87 |
* @throws NullPointerException if key is null |
* @throws NullPointerException if key is null |
88 |
* @see #put(Object, Object) |
* @see #put(Object, Object) |
89 |
*/ |
*/ |
90 |
public abstract Object get(Object key); |
public abstract V get(Object key); |
91 |
|
|
92 |
/** |
/** |
93 |
* Returns true when there are no elements in this Dictionary. |
* Returns true when there are no elements in this Dictionary. |
102 |
* @return an Enumeration of the keys |
* @return an Enumeration of the keys |
103 |
* @see #elements() |
* @see #elements() |
104 |
*/ |
*/ |
105 |
public abstract Enumeration keys(); |
public abstract Enumeration<K> keys(); |
106 |
|
|
107 |
/** |
/** |
108 |
* Inserts a new value into this Dictionary, located by the |
* Inserts a new value into this Dictionary, located by the |
115 |
* @throws NullPointerException if key or value is null |
* @throws NullPointerException if key or value is null |
116 |
* @see #get(Object) |
* @see #get(Object) |
117 |
*/ |
*/ |
118 |
public abstract Object put(Object key, Object value); |
public abstract V put(K key, V value); |
119 |
|
|
120 |
/** |
/** |
121 |
* Removes from the Dictionary the value located by the given key. A null |
* Removes from the Dictionary the value located by the given key. A null |
125 |
* @return the value associated with the removed key |
* @return the value associated with the removed key |
126 |
* @throws NullPointerException if key is null |
* @throws NullPointerException if key is null |
127 |
*/ |
*/ |
128 |
public abstract Object remove(Object key); |
public abstract V remove(K key); |
129 |
|
|
130 |
/** |
/** |
131 |
* Returns the number of values currently in this Dictionary. |
* Returns the number of values currently in this Dictionary. |