|
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.HashObjLongNS
public class HashObjLongNS
Hashtable for mapping Object keys to long values. The methods of this hashtable are not synchronized, and if used concurently must be externally synchronized
| Field Summary | |
|---|---|
java.lang.Object[] |
keys
Used to enumerate the keys in the hash table. |
int[] |
next
Can be used to check if a key or value is valid. |
long[] |
values
Used to enumerate the values in the hash table. |
| Constructor Summary | |
|---|---|
HashObjLongNS()
Constructs an empty hash table with keys of type int and values af type Object. |
|
HashObjLongNS(int capacity)
Constructs an empty hash table with keys of type int and values af type Object. |
|
HashObjLongNS(int capacity,
double lf)
Constructs an empty hash table with keys of type int and values of type Object. |
|
| Method Summary | |
|---|---|
long |
get(java.lang.Object key)
Returns an value which is mapped to the key key. |
void |
put(java.lang.Object key,
long 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. |
long |
remove(java.lang.Object 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 java.lang.Object[] keys
i is valid
only if
keys[i] != null
public long[] values
i is valid
only if
keys[i] != null
public int[] next
i is valid
if the following expression is true
next[i] != -1 && next[i] < next.length
| Constructor Detail |
|---|
public HashObjLongNS()
public HashObjLongNS(int capacity)
capacity - initial capacity of the table
java.lang.IllegalArgumentException - if capacity < 1.
public HashObjLongNS(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(java.lang.Object key,
long 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 long get(java.lang.Object key)
key key. If there is no
such a key, throws NoSuchElementException.
key - the key we are searching for
java.util.NoSuchElementException - if there is no element with the specified key.public long remove(java.lang.Object key)
NoSuchElementException if there is no element with this key.
key - the key of the element we want to remove
java.util.NoSuchElementException - if there is no element with the specified key.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 | ||||||||