|
Oracle | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compoze.util.PeekableIterator
public class PeekableIterator
This class implements an iterator that is "peekable", or one whose next element may be viewed without considering the next element in the iteration.
Constructor Summary | |
---|---|
PeekableIterator(java.util.Iterator it)
Constructor. |
Method Summary | |
---|---|
boolean |
hasNext()
Return true if the iteration has more elements. |
java.lang.Object |
next()
Return the next element in the iteration. |
java.lang.Object |
peek()
Peek at the next element without considering it the next element in the iteration. |
void |
remove()
Remove the last element returned by the iterator (not implemented). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PeekableIterator(java.util.Iterator it)
Method Detail |
---|
public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
public java.lang.Object peek()
public void remove()
remove
in interface java.util.Iterator
java.lang.UnsupportedOperationException
- if the underlying iterator does not
implement this method
|
Oracle | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |