|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.prosyst.util.hash.HashIntObjNS
public class HashIntObjNS
Hashtable for mapping int keys to Object values. The methods of this hashtable are not synchronized, and if used concurently must be externally synchronized
| Field Summary | |
|---|---|
int[] |
keys
Used to enumerate the keys in the hash table. |
int[] |
next
Can be used to check if a key or value is valid. |
java.lang.Object[] |
values
Used to enumerate the values in the hash table. |
| Constructor Summary | |
|---|---|
HashIntObjNS()
Constructs an empty hash table with keys of type int and values af type Object. |
|
HashIntObjNS(int capacity)
Constructs an empty hash table with keys of type int and values af type Object. |
|
HashIntObjNS(int capacity,
double lf)
Constructs an empty hash table with keys of type int and values of type Object. |
|
| Method Summary | |
|---|---|
java.lang.Object |
get(int key)
Returns an value which is mapped to the key key. |
void |
put(int key,
java.lang.Object value)
Adds in the hashtable an element with key key and value value. |
void |
rehash()
Rehashes the contents of the hashtable into a hashtable with a larger capacity. |
java.lang.Object |
remove(int key)
Removes an element with the specified key from the table. |
void |
removeAll()
Empties the hash table |
int |
size()
Returns the count of elements currently in the table |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int[] keys
i is valid
only if
values[i] != null
public java.lang.Object[] values
i is valid
only if
values[i] != null
public int[] next
i is valid
if the following expression is true
next[i] != -1 && next[i] < next.length
| Constructor Detail |
|---|
public HashIntObjNS()
public HashIntObjNS(int capacity)
capacity - initial capacity of the table
java.lang.IllegalArgumentException - if capacity < 1.
public HashIntObjNS(int capacity,
double lf)
capacity - initial capacity of the tablelf - load factor ot the table
java.lang.IllegalArgumentException - if capacity < 1 or lf < 0.0| Method Detail |
|---|
public void put(int key,
java.lang.Object value)
key key and value value.
If an element with the specified key is already in the table only change it's value.
key - the key of the inserted elementvalue - the value of the inserted elementpublic java.lang.Object get(int key)
key key.
key - the key we are searching for
public java.lang.Object remove(int key)
key - the key of the element we want to remove
public void removeAll()
public void rehash()
public int size()
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||