Package org.apache.commons.net.nntp
Class ReplyIterator
- java.lang.Object
-
- org.apache.commons.net.nntp.ReplyIterator
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.String>,java.util.Iterator<java.lang.String>
class ReplyIterator extends java.lang.Object implements java.util.Iterator<java.lang.String>, java.lang.Iterable<java.lang.String>Wraps aBufferedReaderand returns anIterable<String>which returns the individual lines from the reader.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringlineprivate java.io.BufferedReaderreaderprivate java.lang.ExceptionsavedException
-
Constructor Summary
Constructors Constructor Description ReplyIterator(java.io.BufferedReader _reader)ReplyIterator(java.io.BufferedReader _reader, boolean addDotReader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()java.util.Iterator<java.lang.String>iterator()java.lang.Stringnext()voidremove()
-
-
-
Constructor Detail
-
ReplyIterator
ReplyIterator(java.io.BufferedReader _reader, boolean addDotReader) throws java.io.IOException- Parameters:
_reader- the reader to wrapaddDotReader- whether to additionally wrap the reader in a DotTerminatedMessageReader- Throws:
java.io.IOException
-
ReplyIterator
ReplyIterator(java.io.BufferedReader _reader) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<java.lang.String>
-
next
public java.lang.String next() throws java.util.NoSuchElementException- Specified by:
nextin interfacejava.util.Iterator<java.lang.String>- Throws:
java.util.NoSuchElementException
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<java.lang.String>
-
iterator
public java.util.Iterator<java.lang.String> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.String>
-
-