|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Reader java.io.BufferedReader groovy.io.LineColumnReader
public class LineColumnReader extends BufferedReader
The LineColumnReader
is an extension to BufferedReader
that keeps track of the line and column information of where the cursor is.
Constructor Summary | |
LineColumnReader(Reader reader)
Constructor wrapping a |
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, int startOffset, int length)
Reads characters into a portion of an array. |
int
|
read(char[] chars)
Reads characters into an array. |
int
|
read(CharBuffer buffer)
Not implemented. |
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 BufferedReader | |
---|---|
close, readLine, mark, reset, read, read, skip, markSupported, ready, read, read, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Methods inherited from class Reader | |
---|---|
close, mark, reset, read, read, read, read, skip, markSupported, ready, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail |
---|
public LineColumnReader(Reader reader)
Reader
(FileReader
, FileReader
, InputStreamReader
, etc.)
reader
- the reader to wrap
Method Detail |
---|
@Override public void close()
public long getColumn()
public long getColumnMark()
public long getLine()
public long getLineMark()
@Override public void mark(int readAheadLimit)
readAheadLimit
- 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.
@Override public int read()
@Overrideif (readInt == -1) return i - startOffset; public int read(char[] chars, int startOffset, int length)
chars
- Destination array of charstartOffset
- Offset at which to start storing characterslength
- Maximum number of characters to read
@Override public int read(char[] chars)
chars
- Destination buffer
@Override public int read(CharBuffer buffer)
buffer
- Destination buffer
@Overrideint intRead = read(); public String readLine()
@Override public void reset()
public void setColumn(long column)
public void setColumnMark(long columnMark)
public void setLine(long line)
public void setLineMark(long lineMark)
@Overrideif (intRead == -1) return i; public long skip(long toSkip)
toSkip
- the number of characters to skip
Copyright © 2003-2013 The Codehaus. All rights reserved.