|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- public interface ExtendedIterator<T>
This interface extends regular iterators with the ability to replace
the last element seen, using replace(Object)
.
Method Summary | |
---|---|
void |
replace(T newValue)
Replaces in the underlying collection the last element returned by the iterator with the given value. |
Methods inherited from interface java.util.Iterator |
---|
hasNext, next, remove |
Method Detail |
---|
void replace(T newValue)
Iterator.next()
, and only if Iterator.remove()
was not called since the last call to next
. Calling remove
after calling this method is also not permitted. The
behavior of an iterator is unspecified if the underlying collection is modified
while the iteration is in progress in any way other than by calling this method
or remove
.
newValue
-
IllegalStateException
- If the next
method has not yet been
called, or remove
or replace
has already been called
after the last call to the next
method.Iterator.remove()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |