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

Variable Index

 o count
 o loadFactor
 o table
 o threshold

Constructor Index

 o IntHashtable()
 o IntHashtable(int)
 o IntHashtable(int, float)
Constructs a new, empty hashtable with the specified initial capacity and the specified load factor.

Method Index

 o clear()
 o clone()
 o contains(Object)
 o containsKey(int)
 o elements()
 o get(int)
 o get(Object)
 o isEmpty()
 o keys()
 o put(int, Object)
 o put(Object, Object)
 o rehash()
 o remove(int)
 o remove(Object)
 o size()
 o toString()

Variables

 o table
 private IntHashtableEntry table[]
 o count
 private int count
 o threshold
 private int threshold
 o loadFactor
 private float loadFactor

Constructors

 o 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)
 o IntHashtable
 public IntHashtable(int initialCapacity)
 o IntHashtable
 public IntHashtable()

Methods

 o size
 public int size()
Overrides:
size in class Dictionary
 o isEmpty
 public boolean isEmpty()
Overrides:
isEmpty in class Dictionary
 o keys
 public synchronized Enumeration keys()
Overrides:
keys in class Dictionary
 o elements
 public synchronized Enumeration elements()
Overrides:
elements in class Dictionary
 o contains
 public synchronized boolean contains(Object value)
 o containsKey
 public synchronized boolean containsKey(int key)
 o get
 public synchronized Object get(int key)
 o get
 public Object get(Object okey)
Overrides:
get in class Dictionary
 o rehash
 protected void rehash()
 o put
 public synchronized Object put(int key,
                                Object value)
 o put
 public Object put(Object okey,
                   Object value)
Overrides:
put in class Dictionary
 o remove
 public synchronized Object remove(int key)
 o remove
 public Object remove(Object okey)
Overrides:
remove in class Dictionary
 o clear
 public synchronized void clear()
 o clone
 public synchronized Object clone()
Overrides:
clone in class Object
 o toString
 public synchronized String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index