|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstructure.AbstractIterator
structure.ArrayIterator
public class ArrayIterator
Constructor Summary | |
---|---|
ArrayIterator(Object[] source)
|
|
ArrayIterator(Object[] source,
int first,
int size)
|
Method Summary | |
---|---|
Object |
get()
Returns the value currently being considered by the AbstractIterator. |
boolean |
hasNext()
Returns true if the iterator has more elements to visit. |
Object |
next()
Moves, bumps, or "increments" the iterator along the traversal; returns the next value considered. |
void |
reset()
Reset iterator to the beginning of the structure. |
Methods inherited from class structure.AbstractIterator |
---|
hasMoreElements, nextElement, remove, value |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayIterator(Object[] source)
public ArrayIterator(Object[] source, int first, int size)
Method Detail |
---|
public void reset()
AbstractIterator
Iterator
or
Enumeration
implementation, but some traversals
may allow efficient multi-pass implementations with little
overhead. The user is encouraged to implement this method.
reset
in class AbstractIterator
public boolean hasNext()
AbstractIterator
hasMoreElements
is an
Enumeration
-required call to this method. The user
should override only this method.
hasNext
in interface Iterator
hasNext
in class AbstractIterator
AbstractIterator.hasMoreElements()
public Object next()
AbstractIterator
value
method.
This method is preferred over the nextElement
method.
next
in interface Iterator
next
in class AbstractIterator
AbstractIterator.hasMoreElements()
,
AbstractIterator.value()
public Object get()
AbstractIterator
Iterator
nor
Enumeration
. This method should be implemented,
however, to provide better support for for
-loops.
get
in class AbstractIterator
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |