|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.statcvs.util.LookaheadReader
Wraps a Reader for line-by-line access. Allows reading
the current line multiple times. At construction time, the
LookaheadReader points to line 1 of the source reader. Calls to
getCurrentLine() will return the first line of the source reader.
A call to getNextLine() causes a readLine from the source reader.
Subsequent calls to getCurrentLine() will return the second line
of the source reader.
| Constructor Summary | |
LookaheadReader(java.io.Reader reader)
Constructor |
|
| Method Summary | |
java.lang.String |
getCurrentLine()
Returns the current line without reading a line from the source reader. |
int |
getLineNumber()
Returns the current line number |
java.lang.String |
getNextLine()
Reads and returns a line from the source reader. |
boolean |
isAfterEnd()
Returns true if the last call to getNextLine()
returned null |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LookaheadReader(java.io.Reader reader)
reader - a BufferedReader| Method Detail |
public java.lang.String getCurrentLine()
throws java.io.IOException
java.io.IOException - on error while reading the source reader
public java.lang.String getNextLine()
throws java.io.IOException
java.io.IOException - on error while reading the source reader
public int getLineNumber()
throws java.io.IOException
java.io.IOException - on error while reading the underlying reader
public boolean isAfterEnd()
throws java.io.IOException
getNextLine()
returned null
java.io.IOException - on error while reading the source reader
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||