All Packages Class Hierarchy This Package Previous Next Index
Class picture.IntHashtable
java.lang.Object
|
+----java.util.Dictionary
|
+----picture.IntHashtable
- public class IntHashtable
- extends Dictionary
- implements Cloneable
A Hashtable that uses ints as the keys.
Use just like java.util.Hashtable, except that the keys must be ints.
This is much faster than creating a new Integer for each access.
Fetch the software.
Fetch the entire Acme package.
- See Also:
- Hashtable
-
count
-
-
loadFactor
-
-
table
-
-
threshold
-
-
IntHashtable()
-
-
IntHashtable(int)
-
-
IntHashtable(int, float)
- Constructs a new, empty hashtable with the specified initial
capacity and the specified load factor.
-
clear()
-
-
clone()
-
-
contains(Object)
-
-
containsKey(int)
-
-
elements()
-
-
get(int)
-
-
get(Object)
-
-
isEmpty()
-
-
keys()
-
-
put(int, Object)
-
-
put(Object, Object)
-
-
rehash()
-
-
remove(int)
-
-
remove(Object)
-
-
size()
-
-
toString()
-
table
private IntHashtableEntry table[]
count
private int count
threshold
private int threshold
loadFactor
private float loadFactor
IntHashtable
public IntHashtable(int initialCapacity,
float loadFactor)
- Constructs a new, empty hashtable with the specified initial
capacity and the specified load factor.
- Parameters:
- initialCapacity - the initial number of buckets
- loadFactor - a number between 0.0 and 1.0, it defines
the threshold for rehashing the hashtable into
a bigger one.
- Throws: IllegalArgumentException
- If the initial capacity
is less than or equal to zero.
- Throws: IllegalArgumentException
- If the load factor is
less than or equal to zero.
see source for extra comments (it is not in javadoc format)
IntHashtable
public IntHashtable(int initialCapacity)
IntHashtable
public IntHashtable()
size
public int size()
- Overrides:
- size in class Dictionary
isEmpty
public boolean isEmpty()
- Overrides:
- isEmpty in class Dictionary
keys
public synchronized Enumeration keys()
- Overrides:
- keys in class Dictionary
elements
public synchronized Enumeration elements()
- Overrides:
- elements in class Dictionary
contains
public synchronized boolean contains(Object value)
containsKey
public synchronized boolean containsKey(int key)
get
public synchronized Object get(int key)
get
public Object get(Object okey)
- Overrides:
- get in class Dictionary
rehash
protected void rehash()
put
public synchronized Object put(int key,
Object value)
put
public Object put(Object okey,
Object value)
- Overrides:
- put in class Dictionary
remove
public synchronized Object remove(int key)
remove
public Object remove(Object okey)
- Overrides:
- remove in class Dictionary
clear
public synchronized void clear()
clone
public synchronized Object clone()
- Overrides:
- clone in class Object
toString
public synchronized String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index