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>
final class ReplyIterator extends java.lang.Object implements java.util.Iterator<java.lang.String>, java.lang.Iterable<java.lang.String>
Wraps aBufferedReader
and 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.String
line
private java.io.BufferedReader
reader
private java.lang.Exception
savedException
-
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 boolean
hasNext()
java.util.Iterator<java.lang.String>
iterator()
java.lang.String
next()
void
remove()
-
-
-
Constructor Detail
-
ReplyIterator
ReplyIterator(java.io.BufferedReader _reader) throws java.io.IOException
- Throws:
java.io.IOException
-
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
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<java.lang.String>
-
iterator
public java.util.Iterator<java.lang.String> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.String>
-
next
public java.lang.String next() throws java.util.NoSuchElementException
- Specified by:
next
in interfacejava.util.Iterator<java.lang.String>
- Throws:
java.util.NoSuchElementException
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<java.lang.String>
-
-