|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.Reader
java.io.BufferedReader
groovy.io.LineColumnReader
public class LineColumnReader
The LineColumnReader is an extension to BufferedReader
that keeps track of the line and column information of where the cursor is.
| Field Summary |
|---|
| Fields inherited from class java.io.Reader |
|---|
lock |
| Constructor Summary | |
|---|---|
LineColumnReader(java.io.Reader reader)
Constructor wrapping a Reader
(FileReader, FileReader, InputStreamReader, etc.) |
|
| Method Summary | |
|---|---|
void |
close()
Closes the stream and releases any system resources associated with it. |
long |
getColumn()
|
long |
getColumnMark()
|
long |
getLine()
|
long |
getLineMark()
|
void |
mark(int readAheadLimit)
Marks the present position in the stream. |
int |
read()
Reads a single character. |
int |
read(char[] chars)
Reads characters into an array. |
int |
read(char[] chars,
int startOffset,
int length)
Reads characters into a portion of an array. |
int |
read(java.nio.CharBuffer buffer)
Not implemented. |
java.lang.String |
readLine()
Reads a line of text. |
void |
reset()
Resets the stream to the most recent mark. |
void |
setColumn(long column)
|
void |
setColumnMark(long columnMark)
|
void |
setLine(long line)
|
void |
setLineMark(long lineMark)
|
long |
skip(long toSkip)
Skips characters. |
| Methods inherited from class java.io.BufferedReader |
|---|
markSupported, ready |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LineColumnReader(java.io.Reader reader)
Reader
(FileReader, FileReader, InputStreamReader, etc.)
reader - the reader to wrap| Method Detail |
|---|
public void mark(int readAheadLimit)
throws java.io.IOException
mark in class java.io.BufferedReaderreadAheadLimit - Limit on the number of characters that may be read while still preserving the mark.
An attempt to reset the stream after reading characters up to this limit or beyond may fail.
A limit value larger than the size of the input buffer will cause a new buffer to be allocated whose size is no smaller than limit.
Therefore large values should be used with care.
java.io.IOException
public void reset()
throws java.io.IOException
reset in class java.io.BufferedReaderjava.io.IOException
public int read()
throws java.io.IOException
read in class java.io.BufferedReaderjava.io.IOException
public int read(char[] chars,
int startOffset,
int length)
throws java.io.IOException
read in class java.io.BufferedReaderchars - Destination array of charstartOffset - Offset at which to start storing characterslength - Maximum number of characters to read
java.io.IOException
public java.lang.String readLine()
throws java.io.IOException
readLine in class java.io.BufferedReaderjava.io.IOException
public long skip(long toSkip)
throws java.io.IOException
skip in class java.io.BufferedReadertoSkip - the number of characters to skip
java.io.IOException
public int read(char[] chars)
throws java.io.IOException
read in class java.io.Readerchars - Destination buffer
java.io.IOExceptionpublic int read(java.nio.CharBuffer buffer)
read in interface java.lang.Readableread in class java.io.Readerbuffer - Destination buffer
java.lang.UnsupportedOperationException - as the method is not implemented
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.BufferedReaderjava.io.IOExceptionpublic long getColumn()
public void setColumn(long column)
public long getColumnMark()
public void setColumnMark(long columnMark)
public long getLine()
public void setLine(long line)
public long getLineMark()
public void setLineMark(long lineMark)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||