| |
|
| java.lang.Object gnu.trove.TIterator
All known Subclasses: gnu.trove.THashIterator, gnu.trove.TPrimitiveIterator,
TIterator | abstract class TIterator (Code) | | 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.
author: Eric D. Friedman version: $Id: TIterator.java,v 1.3 2007/06/29 20:03:10 robeden Exp $ |
Field Summary | |
protected int | _expectedSize the number of elements this iterator believes are in the
data structure it accesses. | final protected THash | _hash | protected int | _index the index used for iteration. |
Constructor Summary | |
public | TIterator(THash hash) Create an instance of TIterator over the specified THash. |
Method Summary | |
public boolean | hasNext() Returns true if the iterator can be advanced past its current
location. | final protected void | moveToNextIndex() Sets the internal index so that the `next' object
can be returned. | abstract protected int | nextIndex() Returns the index of the next value in the data structure
or a negative value if the iterator is exhausted. | public void | remove() Removes the last entry returned by the iterator. |
_expectedSize | protected int _expectedSize(Code) | | the number of elements this iterator believes are in the
data structure it accesses.
|
_hash | final protected THash _hash(Code) | | the data structure this iterator traverses
|
_index | protected int _index(Code) | | the index used for iteration.
|
TIterator | public TIterator(THash hash)(Code) | | Create an instance of TIterator over the specified THash.
|
hasNext | public boolean hasNext()(Code) | | Returns true if the iterator can be advanced past its current
location.
a boolean value |
moveToNextIndex | final protected void moveToNextIndex()(Code) | | Sets the internal index so that the `next' object
can be returned.
|
nextIndex | abstract protected int nextIndex()(Code) | | Returns the index of the next value in the data structure
or a negative value if the iterator is exhausted.
an int value |
remove | public void remove()(Code) | | Removes the last entry returned by the iterator.
Invoking this method more than once for a single entry
will leave the underlying data structure in a confused
state.
|
|
|
|