|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
echopoint.ui.template.PositionReader
public class PositionReader
A PositionReader
can be asked for the
current position in the stream as well as the
current logical line number.
Field Summary |
---|
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
PositionReader(java.io.Reader r)
Constructs a PositionReader based on a source Reader |
Method Summary | |
---|---|
void |
close()
|
long |
getLineNumber()
Get the current line number. |
long |
getPosition()
Returns the current position within the file |
java.io.Reader |
getReader()
Returns the underlying Reader |
void |
mark(int readAheadLimit)
|
boolean |
markSupported()
|
int |
read()
Read a single character. |
int |
read(char[] cbuff)
|
int |
read(char[] cbuff,
int off,
int len)
Read characters into a portion of an array. |
boolean |
ready()
|
void |
reset()
|
void |
setLineNumber(int lineNumber)
Set the current line number. |
long |
skip(long n)
|
java.lang.String |
toString()
|
Methods inherited from class java.io.Reader |
---|
read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PositionReader(java.io.Reader r)
PositionReader
based on a source Reader
r
- the Reader to actually read fromMethod Detail |
---|
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.Reader
java.io.IOException
Reader.close()
public long getLineNumber()
setLineNumber(int)
public long getPosition()
public void mark(int readAheadLimit) throws java.io.IOException
mark
in class java.io.Reader
java.io.IOException
Reader.mark(int)
public boolean markSupported()
markSupported
in class java.io.Reader
Reader.markSupported()
public int read() throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
- If an I/O error occurspublic int read(char[] cbuff, int off, int len) throws java.io.IOException
read
in class java.io.Reader
cbuff
- Destination bufferoff
- Offset at which to start storing characterslen
- Maximum number of characters to read
java.io.IOException
- If an I/O error occurspublic int read(char[] cbuff) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
Reader.read(char[])
public boolean ready() throws java.io.IOException
ready
in class java.io.Reader
java.io.IOException
Reader.ready()
public void reset() throws java.io.IOException
reset
in class java.io.Reader
java.io.IOException
Reader.reset()
public void setLineNumber(int lineNumber)
lineNumber
- an int specifying the line number.getLineNumber()
public long skip(long n) throws java.io.IOException
skip
in class java.io.Reader
java.io.IOException
Reader.skip(long)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.io.Reader getReader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |