|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.util.Iterators.Array<E>
public static class Iterators.Array<E>
An Iterator.Array iterates over the elements of an
array specified at construction time. The array is not copied,
so any changes in the underlying array are reflected in the
iterator.
Implementation Note: this class does not automatically
free references in the underlying array, because the array
may be used elswhere. If reference freeing is critical here,
a call to remove() after ever next()
will free the references in the array.
| Constructor Summary | |
|---|---|
Iterators.Array(E[] members)
Construct an array iterator from the specified array. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
Returns true if this iterator has more
elements. |
E |
next()
Returns the next element in the array. |
void |
remove()
Sets position in underlying array corresponding to the most recently returned token to null. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Iterators.Array(E[] members)
members - Array basis of the constructed iterator.| Method Detail |
|---|
public boolean hasNext()
true if this iterator has more
elements.
hasNext in interface Iterator<E>true if this iterator has more
elements.public E next()
next in interface Iterator<E>NoSuchElementException - If there are no more
elements left in the array to return.public void remove()
null.
remove in interface Iterator<E>IllegalStateException - If the next
method has not been called, or the remove
method has already been called after the last call to the
next method.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||