Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.nntp.spi
Class DotIterator

java.lang.Object
  extended by com.jivesoftware.forum.nntp.spi.PeekIterator
      extended by com.jivesoftware.forum.nntp.spi.DotIterator
All Implemented Interfaces:
java.util.Iterator

public class DotIterator
extends PeekIterator

Iterator that continues until the underlying iterator runs out or a message terminating dot is seen.


Constructor Summary
DotIterator(java.util.Iterator itr)
          Create an iterator that wraps the given one.
 
Method Summary
 boolean hasNext()
          Returns true if there are more elements that can be returned from calls to next() or peek() using both the end of the underlying iterator and/or the occurance of a dot on a line by itself.
 java.lang.Object next()
          Returns the next element and moves the iterator forward.
 java.lang.Object peek()
          Peeks into the next element without iterating.
 
Methods inherited from class com.jivesoftware.forum.nntp.spi.PeekIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotIterator

public DotIterator(java.util.Iterator itr)
Create an iterator that wraps the given one.

Parameters:
itr - the iterator to wrap.
Method Detail

hasNext

public boolean hasNext()
Returns true if there are more elements that can be returned from calls to next() or peek() using both the end of the underlying iterator and/or the occurance of a dot on a line by itself.

Specified by:
hasNext in interface java.util.Iterator
Overrides:
hasNext in class PeekIterator
Returns:
true if there are more elements to iterate over.

next

public java.lang.Object next()
Description copied from class: PeekIterator
Returns the next element and moves the iterator forward.

Specified by:
next in interface java.util.Iterator
Overrides:
next in class PeekIterator
Returns:
The next element of the iterator

peek

public java.lang.Object peek()
Description copied from class: PeekIterator
Peeks into the next element without iterating. Essentially the same as the normal Iterator.next() method minus the side effect of moving the iterator.

Overrides:
peek in class PeekIterator
Returns:
The next element of the iterator

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.