|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspiffy.core.util.PushBackIterator<T>
public class PushBackIterator<T>
The PushBackIterator enables you to iterate and push back elements should you find that "you have come to far". You can push elements back in the iterator which then will be re-visited upon the subsequent call to next()
Constructor Summary | |
---|---|
PushBackIterator(Iterator<T> iterator)
|
Method Summary | |
---|---|
boolean |
hasNext()
Returns true if the iteration has more elements. |
T |
next()
Returns the next element in the iteration. |
void |
pushBack()
Push back the last fetched element |
void |
remove()
Operation currently not supported |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PushBackIterator(Iterator<T> iterator)
iterator
- the iterator to wrap in order to get the push back functionality.Method Detail |
---|
public boolean hasNext()
hasNext
in interface Iterator<T>
public T next()
next
in interface Iterator<T>
public void pushBack()
public void remove()
remove
in interface Iterator<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |