public interface IHash
Modifier and Type | Method and Description |
---|---|
boolean |
insert(java.lang.String key)
Add a key to the hash table, if it is not currently in the table
|
java.util.Iterator<java.lang.String> |
iterator()
Get an iterator that return the Strings stored in
the hash table one at a time.
|
java.util.Iterator<java.lang.String> |
iterator(int i)
Get an iterator for the ith bucket
|
void |
print()
Print the entire hash table.
|
boolean |
remove(java.lang.String key)
Remove a key from the hash table
|
java.lang.String |
search(java.lang.String key)
Search for a key in the hash table
|
int |
size()
Get the number of elements in the hash table
|
int |
size(int i)
Get the number of elements in the hash table at the given index
|
boolean insert(java.lang.String key)
key
- - the key to addboolean remove(java.lang.String key)
key
- - the key to removejava.lang.String search(java.lang.String key)
key
- - the key to search forint size()
int size(int i)
i
- the index in the hash table (0 to size-1)java.util.Iterator<java.lang.String> iterator()
java.util.Iterator<java.lang.String> iterator(int i)
i
- the index in the hash table (0 to size-1)void print()