org.apache.bsf.debug.util
Class IntHashtable
java.lang.Object
org.apache.bsf.debug.util.IntHashtable
- Cloneable
public class IntHashtable
extends java.lang.Object
implements Cloneable
Hashtable associates keys with values. Keys and values cannot be null.
The size of the Hashtable is the number of key/value pairs it contains.
The capacity is the number of key/value pairs the Hashtable can hold.
The load factor is a float value which determines how full the Hashtable
gets before expanding the capacity. If the load factor of the Hashtable
is exceeded, the capacity is doubled.
Enumeration
, java.io.Serializable
, java.lang.Object.equals
, java.lang.Object.hashCode
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.
|
void | clear() - Removes all key/value pairs from this IntHashtable, leaving the size zero
and the capacity unchanged.
|
Object | clone() - Answers a new IntHashtable with the same key/value pairs, capacity
and load factor.
|
boolean | contains(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.
|
Enumeration | elements() - Answers an Enumeration on the values of this Hashtable.
|
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.
|
Object | put(int key, Object value) - Associate the specified value with the specified key in this Hashtable.
|
protected void | rehash() - Increases the capacity of this Hashtable.
|
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.
|
String | toString() - Answers the string representation of this Hashtable.
|
IntHashtable
public IntHashtable()
Constructs a new Hashtable using the default capacity
and load factor.
IntHashtable
public IntHashtable(int capacity)
Constructs a new IntHashtable using the specified capacity
and the default load factor.
capacity
- the initial capacity
IntHashtable
public IntHashtable(int capacity,
float loadFactor)
Constructs a new IntHashtable using the specified capacity
and load factor.
capacity
- the initial capacityloadFactor
- the initial load factor
clear
public void clear()
Removes all key/value pairs from this IntHashtable, leaving the size zero
and the capacity unchanged.
clone
public Object clone()
Answers a new IntHashtable with the same key/value pairs, capacity
and load factor.
- a shallow copy of this IntHashtable
contains
public boolean contains(Object value)
Answers if this Hashtable contains the specified object as the value
of at least one of the key/value pairs.
value
- the object to look for as a value in this Hashtable
- true if object is a value in this Hashtable, false otherwise
containsKey
public boolean containsKey(int key)
Answers if this Hashtable contains the specified object as a key
of one of the key/value pairs.
key
- the object to look for as a key in this Hashtable
- true if object is a key in this Hashtable, false otherwise
elements
public Enumeration elements()
Answers an Enumeration on the values of this Hashtable. The
results of the Enumeration may be affected if the contents
of this Hashtable are modified.
- an Enumeration of the values of this Hashtable
IntHashtable
, size()
, Enumeration
get
public Object get(int key)
Answers the value associated with the specified key in
this Hashtable.
key
- the key of the value returned
- the value associated with the specified key, null if the specified key
does not exist
isEmpty
public boolean isEmpty()
Answers if this Hashtable has no key/value pairs, a size of zero.
- true if this Hashtable has no key/value pairs, false otherwise
put
public Object put(int key,
Object value)
Associate the specified value with the specified key in this Hashtable.
If the key already exists, the old value is replaced. The key and value
cannot be null.
key
- the key to addvalue
- the value to add
- the old value associated with the specified key, null if the key did
not exist
rehash
protected void rehash()
Increases the capacity of this Hashtable. This method is sent when
the size of this Hashtable exceeds the load factor.
remove
public Object remove(int key)
Remove the key/value pair with the specified key from this Hashtable.
- the value associated with the specified key, null if the specified key
did not exist
size
public int size()
Answers the number of key/value pairs in this Hashtable.
- the number of key/value pairs in this Hashtable
toString
public String toString()
Answers the string representation of this Hashtable.
- the string representation of this Hashtable