|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.nntp.spi.PeekIterator
public class PeekIterator
A simple iterator wrapper that allows a caller to peek into the next element without actually iterating over it.
Constructor Summary | |
---|---|
PeekIterator(java.util.Iterator itr)
Wraps the given iterator in this one to make it peek()'able. |
|
PeekIterator(java.util.Iterator itr,
java.lang.Object firstItem)
Wraps the given iterator in this one to make it peek()'able and adding the given line as the first line to peek. |
Method Summary | |
---|---|
boolean |
hasNext()
Returns true if there are more elements that can be returned from calls to next() or peek(). |
java.lang.Object |
next()
Returns the next element and moves the iterator forward. |
java.lang.Object |
peek()
Peeks into the next element without iterating. |
void |
remove()
Unsupported operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PeekIterator(java.util.Iterator itr)
itr
- The iterator to wrappublic PeekIterator(java.util.Iterator itr, java.lang.Object firstItem)
itr
- the iterator to wrapfirstItem
- the first line to peekMethod Detail |
---|
public java.lang.Object peek()
public void remove() throws java.lang.UnsupportedOperationException
remove
in interface java.util.Iterator
java.lang.UnsupportedOperationException
- If the underlying iterator doesn't
support remove()public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |