|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.util.Dictionary
|
+--util.DupHashtable
This class implements a Hashtable, which allows to store the same key several times. More see: java.util.Hashtable
| Constructor Summary | |
DupHashtable()
Constructs a new, empty DupHashtable with a default capacity and load factor. |
|
DupHashtable(int initialCapacity)
Constructs a new, empty DupHashtable with the specified initial capacity and default load factor. |
|
DupHashtable(int initialCapacity,
float loadFactor)
Constructs a new, empty DupHashtable with the specified initial capacity and the specified load factor. |
|
| Method Summary | |
void |
clear()
Clears this DupHashtable so that it contains no keys. |
java.lang.Object |
clone()
Creates a shallow copy of this DupHashtable. |
boolean |
contains(java.lang.Object value)
Tests if some key maps into the specified value in this DupHashtable. |
boolean |
containsKey(java.lang.Object key)
Tests if the specified object is a key in this DupHashtable. |
java.util.Enumeration |
elements()
Returns an enumeration of the values in this DupHashtable. |
java.lang.Object |
get(java.lang.Object key)
Returns the value to which the specified key is mapped in this DupHashtable. |
java.lang.Object |
getNext(java.lang.Object key)
Returns the value to which the specified key is mapped in this DupHashtable. |
boolean |
isEmpty()
Tests if this DupHashtable maps no keys to values. |
java.util.Enumeration |
keys()
Returns an enumeration of the keys in this DupHashtable. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Maps the specified key to the specified
value in this DupHashtable. |
protected void |
rehash()
Rehashes the contents of the DupHashtable into a DupHashtable with a larger capacity. |
java.lang.Object |
remove(java.lang.Object key)
Removes the key (and its corresponding value) from this DupHashtable. |
int |
size()
Returns the number of keys in this DupHashtable. |
java.lang.String |
toString()
Returns a rather long string representation of this DupHashtable. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DupHashtable()
public DupHashtable(int initialCapacity)
initialCapacity - the initial capacity of the DupHashtable.
public DupHashtable(int initialCapacity,
float loadFactor)
initialCapacity - the initial capacity of the DupHashtable.loadFactor - a number between 0.0 and 1.0.
java.lang.IllegalArgumentException - if the initial capacity is less
than or equal to zero, or if the load factor is less than
or equal to zero.| Method Detail |
public void clear()
public java.lang.Object clone()
clone in class java.lang.Objectpublic boolean contains(java.lang.Object value)
containsKey
method.
value - a value to search for.
true if some key maps to the
value argument in this DupHashtable;
false otherwise.
java.lang.NullPointerException - if the value is null.containsKey(java.lang.Object)public boolean containsKey(java.lang.Object key)
key - possible key.
true if the specified object is a key in this
DupHashtable; false otherwise.contains(java.lang.Object)public java.util.Enumeration elements()
elements in class java.util.DictionaryEnumeration,
keys()public java.lang.Object get(java.lang.Object key)
get in class java.util.Dictionarykey - a key in the DupHashtable.
null if the key is not mapped to any value in
this DupHashtable.public java.lang.Object getNext(java.lang.Object key)
key - a key in the DupHashtable.
null if the key is not mapped to any value in
this DupHashtable.public boolean isEmpty()
isEmpty in class java.util.Dictionarytrue if this DupHashtable maps no keys to values;
false otherwise.public java.util.Enumeration keys()
keys in class java.util.DictionaryEnumeration,
elements()
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
key to the specified
value in this DupHashtable. Neither the key nor the
value can be null.
put in class java.util.Dictionarykey - the key.value - the value.
null if it did not have one.
java.lang.NullPointerException - if the key or value is null.protected void rehash()
public java.lang.Object remove(java.lang.Object key)
remove in class java.util.Dictionarykey - the key that needs to be removed.
null if the key did not have a mapping.public int size()
size in class java.util.Dictionarypublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||