|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cytoscape.util.intr.LongLongHash
public final class LongLongHash
An insert-only hashtable that has non-negative 64 bit integer keys and non-negative 64 bit integer values.
In the underlying implementation, this hashtable increases in size to adapt to key/value pairs being added (the underlying size of the hashtable is invisible to the programmer). In the underlying implementation, this hashtable never decreases in size. As a hashtable increases in size, it takes at most four times as much memory as it would take to store the hashtable's keys and values in a perfectly-sized array. Underlying size expansions are implemented such that the operation of expanding in size is amortized over the contstant time complexity needed to insert new elements.
An instance of this class is serializable; however, serialized instances of this class should not be stored in a persistent manner because the serialization implemented in this class makes no attempt at handling class versioning.
Constructor Summary | |
---|---|
LongLongHash()
Creates a new hashtable. |
Method Summary | |
---|---|
void |
empty()
Removes all key/value pairs from this hashtable. |
long |
get(long key)
Returns the value bound to the specified key or -1 if no value is currently bound to the specified key. |
LongEnumerator |
keys()
Returns an enumeration of keys in this hashtable, ordered arbitrarily. |
long |
put(long key,
long value)
Puts a new key/value pair into this hashtable, potentially overwriting an existing value whose key is the same as the one specified. |
int |
size()
Returns the number of key/value pairs currently in this hashtable. |
LongEnumerator |
values()
Returns an enumeration of values in this hashtable, ordered arbitrarily. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LongLongHash()
Method Detail |
---|
public final void empty()
public final int size()
public final long put(long key, long value)
Insertions into the hashtable are performed in [amortized] time complexity O(1).
IllegalArgumentException
- if either key or value is negative.public final long get(long key)
Searches in this hashtable are performed in [amortized] time complexity O(1).
IllegalArgumentException
- if key is negative.public final LongEnumerator keys()
The returned enumeration becomes invalid as soon as put(long, long) or empty() is called on this hashtable; calling methods on an invalid enumeration will cause undefined behavior in the enumerator. The returned enumerator has absolutely no effect on the underlying hashtable.
This method returns in constant time. The returned enumerator returns successive keys in [amortized] time complexity O(1).
It is possible to get the keys() and values() enumerations at the same time and iterate over them simultaneously; then, the ith element of the keys() enumeration is the key into the ith element of the values() enumeration.
public final LongEnumerator values()
The returned enumeration becomes invalid as soon as put(long, long) or empty() is called on this hashtable; calling methods on an invalid enumeration will cause undefined behavior in the enumerator. The returned enumerator has absolutely no effect on the underlying hashtable.
This method returns in constant time. The returned enumerator returns successive values in [amortized] time complexity O(1).
It is possible to get the keys() and values() enumerations at the same time and iterate over them simultaneously; then, the ith element of the keys() enumeration is the key into the ith element of the values() enumeration.
|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |