|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlp.test.util.TabSeparatedReader
public class TabSeparatedReader
Reads strings separated by tabs, newline characters or comments from a
stream. They are returned one by one by the getNext()
method.
Field Summary | |
---|---|
private Reader |
in
The stream from which the strings are read. |
private int |
la
A lookahead character. |
private StringBuilder |
sb
Used to build a string that is returned. |
Constructor Summary | |
---|---|
TabSeparatedReader(Reader in)
Creates a new instance that reads from the given stream. |
Method Summary | |
---|---|
void |
close()
Closes the underlying Reader . |
String |
getNext()
Returns strings separated by tabs, newline characters or comments in the underlying stream one by one. |
private void |
newLA()
Reads the next character from the underlying Reader and stores it
in la . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Reader in
private final StringBuilder sb
private int la
Constructor Detail |
---|
public TabSeparatedReader(Reader in) throws IOException
in
- the stream to read from
IOException
- if an I/O error occurs while reading the first
character from in
Method Detail |
---|
public void close() throws IOException
Reader
.
close
in interface Closeable
IOException
- if a I/O error occurs while closing the underlying
Reader
public String getNext() throws IOException
null
is returned
if the end of stream is reached.
null
if the end of input is reached
IOException
- if a I/O error occurs while reading from the
underlying Reader
private void newLA() throws IOException
Reader
and stores it
in la
.
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |