|
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.HashLongObjNS
public class HashLongObjNS
Hashtable for mapping long keys to Object values. The methods of this hashtable are not synchronized, and if used concurently must be externally synchronized
| Field Summary | |
|---|---|
long[] |
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 | |
|---|---|
HashLongObjNS()
Constructs an empty hash table with keys of type long and values af type int. |
|
HashLongObjNS(HashLongObjNS source)
|
|
HashLongObjNS(int capacity)
Constructs an empty hash table with keys of type long and values af type int. |
|
HashLongObjNS(int capacity,
double lf)
Constructs an empty hash table with keys of type long and values of type int. |
|
| Method Summary | |
|---|---|
java.lang.Object |
get(long key)
Returns an value which is mapped to the key key. |
void |
put(long key,
java.lang.Object value)
Adds in 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(long 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 long[] 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 HashLongObjNS()
public HashLongObjNS(int capacity)
capacity - initial capacity of the table
java.lang.IllegalArgumentException - if capacity < 1.
public HashLongObjNS(int capacity,
double lf)
capacity - initial capacity of the tablelf - load factor ot the table
java.lang.IllegalArgumentException - if capacity < 1 or lf < 0.0public HashLongObjNS(HashLongObjNS source)
| Method Detail |
|---|
public void put(long 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(long key)
key key.
key - the key we are searching for
public java.lang.Object remove(long 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 | ||||||||