public class IntHashtable<E>
extends java.lang.Object
Probing table implementation of hash tables. Note that all "matching" is based on the equals method.
Constructor and Description |
---|
IntHashtable()
Construct the hash table.
|
IntHashtable(int size)
Construct the hash table.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int key)
Search for an item in the hash table.
|
E |
get(int key)
Find an item in the hash table.
|
static void |
main(java.lang.String[] args) |
void |
makeEmpty()
Make the hash table logically empty.
|
void |
put(int key,
E value)
Insert into the hash table.
|
void |
remove(int key)
Remove from the hash table.
|
public IntHashtable()
public IntHashtable(int size)
size
- the approximate initial size.public void put(int key, E value)
key
- the item to insert.public void remove(int key)
key
- the item to remove.public boolean contains(int key)
key
- the item to search for.public E get(int key)
key
- the item to search for.public void makeEmpty()
public static void main(java.lang.String[] args)