|
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.IntHash
public final class IntHash
An insert-only hashtable that has non-negative 32 bit integer keys; no satellite data is stored in this hashtable. An instance of this class is well-suited for efficiently detecting collisions between integers, removing duplicates from a list of integers, or determining the presence of an integer in a list of integers.
In the underlying implementation, this hashtable increases in size to adapt to elements 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 elements 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 of inserting 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 | |
---|---|
IntHash()
Creates a new hashtable. |
Method Summary | |
---|---|
IntEnumerator |
elements()
Returns an enumeration of elements in this hashtable, ordered arbitrarily. |
void |
empty()
Removes all elements from this hashtable. |
int |
get(int value)
Determines whether or not the value specified is in this hashtable. |
int |
put(int value)
Puts a new value into this hashtable if that value is not already in this hashtable; otherwise does nothing. |
int |
size()
Returns the number of elements currently in this hashtable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IntHash()
Method Detail |
---|
public final void empty()
public final int size()
public final int put(int value)
Insertions into the hashtable are performed in [amortized] time complexity O(1).
IllegalArgumentException
- if value is negative.public final int get(int value)
Searches in this hashtable are performed in [amortized] time complexity O(1).
IllegalArgumentException
- if value is negative.public final IntEnumerator elements()
The returned enumeration becomes invalid as soon as put(int) 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 elements in [amortized] time complexity O(1).
|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |