public class IntHashtable
extends java.lang.Object
implements java.lang.Cloneable
Enumeration,
Serializable,
Object.equals(java.lang.Object),
Object.hashCode()| Constructor and Description |
|---|
IntHashtable()
Constructs a new Hashtable using the default capacity
and load factor.
|
IntHashtable(int capacity)
Constructs a new IntHashtable using the specified capacity
and the default load factor.
|
IntHashtable(int capacity,
float loadFactor)
Constructs a new IntHashtable using the specified capacity
and load factor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all key/value pairs from this IntHashtable, leaving the size zero
and the capacity unchanged.
|
java.lang.Object |
clone()
Answers a new IntHashtable with the same key/value pairs, capacity
and load factor.
|
boolean |
contains(java.lang.Object value)
Answers if this Hashtable contains the specified object as the value
of at least one of the key/value pairs.
|
boolean |
containsKey(int key)
Answers if this Hashtable contains the specified object as a key
of one of the key/value pairs.
|
java.util.Enumeration |
elements()
Answers an Enumeration on the values of this Hashtable.
|
java.lang.Object |
get(int key)
Answers the value associated with the specified key in
this Hashtable.
|
boolean |
isEmpty()
Answers if this Hashtable has no key/value pairs, a size of zero.
|
java.lang.Object |
put(int key,
java.lang.Object value)
Associate the specified value with the specified key in this Hashtable.
|
protected void |
rehash()
Increases the capacity of this Hashtable.
|
java.lang.Object |
remove(int key)
Remove the key/value pair with the specified key from this Hashtable.
|
int |
size()
Answers the number of key/value pairs in this Hashtable.
|
java.lang.String |
toString()
Answers the string representation of this Hashtable.
|
public IntHashtable()
public IntHashtable(int capacity)
capacity - the initial capacitypublic IntHashtable(int capacity,
float loadFactor)
capacity - the initial capacityloadFactor - the initial load factorpublic void clear()
public java.lang.Object clone()
clone in class java.lang.ObjectCloneablepublic boolean contains(java.lang.Object value)
value - the object to look for as a value in this HashtablecontainsKey(int),
Object.equals(java.lang.Object)public boolean containsKey(int key)
key - the object to look for as a key in this Hashtablecontains(java.lang.Object),
Object.equals(java.lang.Object)public java.util.Enumeration elements()
#keys,
size(),
Enumerationpublic java.lang.Object get(int key)
key - the key of the value returnedput(int, java.lang.Object)public boolean isEmpty()
size()public java.lang.Object put(int key,
java.lang.Object value)
key - the key to addvalue - the value to addelements(),
get(int),
#keys,
Object.equals(java.lang.Object)protected void rehash()
public java.lang.Object remove(int key)
key - the key to removeget(int),
put(int, java.lang.Object)public int size()
elements(),
#keyspublic java.lang.String toString()
toString in class java.lang.Object