Package | com.ericfeminella.collections |
Interface | public interface Iterator |
Implementors | ArrayIterator, CollectionIterator, StringTokenizer |
Iterator
provides a set of standard operations
which allow client implementations to manage the traversal
of an aggregate object. Iterator
implementations
are not to modify an aggregate, but rather they are to simply
provide an interface into the aggregate.
Method | Defined by | ||
---|---|---|---|
hasNext():Boolean
Determines if there are elements remaining in the
aggregate.
| Iterator | ||
next():*
Retrieves the next element in the aggregate.
| Iterator | ||
position():int
Determines the position of the current element in
the aggreagate.
| Iterator | ||
reset():void
Resets the cursor / index of the Iterator to 0.
| Iterator |
hasNext | () | method |
public function hasNext():Boolean
Determines if there are elements remaining in the aggregate.
ReturnsBoolean — true if an element remains, false if not
|
next | () | method |
public function next():*
Retrieves the next element in the aggregate.
Returns* — next element based on the current index
|
position | () | method |
public function position():int
Determines the position of the current element in the aggreagate.
Returnsint — the current index of the aggreagate
|
reset | () | method |
public function reset():void
Resets the cursor / index of the Iterator to 0.