abstract class TPrimitiveIterator extends TIterator
Note that iteration is fastest if you forego the calls to hasNext in favor of checking the size of the structure yourself and then call next() that many times:
Iterator i = collection.iterator();
for (int size = collection.size(); size-- > 0;) {
Object o = i.next();
}
You may, of course, use the hasNext(), next() idiom too if you aren't in a performance critical spot.
| Modifier and Type | Field and Description |
|---|---|
protected TPrimitiveHash |
_hash
the collection on which this iterator operates.
|
_expectedSize, _index| Constructor and Description |
|---|
TPrimitiveIterator(TPrimitiveHash hash)
Creates a TPrimitiveIterator for the specified collection.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
nextIndex()
Returns the index of the next value in the data structure
or a negative value if the iterator is exhausted.
|
hasNext, moveToNextIndex, removeprotected final TPrimitiveHash _hash
public TPrimitiveIterator(TPrimitiveHash hash)