|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.trove.TIterator
abstract class TIterator
Abstract iterator class for THash implementations. This class provides some of the common iterator operations (hasNext(), remove()) and allows subclasses to define the mechanism(s) for advancing the iterator and returning data.
Field Summary | |
---|---|
protected int |
_expectedSize
the number of elements this iterator believes are in the data structure it accesses. |
protected THash |
_hash
the data structure this iterator traverses |
protected int |
_index
the index used for iteration. |
Constructor Summary | |
---|---|
TIterator(THash hash)
Create an instance of TIterator over the specified THash. |
Method Summary | |
---|---|
boolean |
hasNext()
Returns true if the iterator can be advanced past its current location. |
protected void |
moveToNextIndex()
Sets the internal index so that the `next' object can be returned. |
protected abstract int |
nextIndex()
Returns the index of the next value in the data structure or a negative value if the iterator is exhausted. |
void |
remove()
Removes the last entry returned by the iterator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final THash _hash
protected int _expectedSize
protected int _index
Constructor Detail |
---|
public TIterator(THash hash)
Method Detail |
---|
public boolean hasNext()
boolean
valuepublic void remove()
protected final void moveToNextIndex()
protected abstract int nextIndex()
int
value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |