|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
proyecto.editor.JavaTextPane.DocumentReader
class JavaTextPane.DocumentReader
A reader interface for an abstract document. Since syntax highlighting packages only accept Stings and Readers, this must be used. Since close() method does nothing and a seek() method has been added, this allows us to get some performance improvements through reuse. It can be used even after lexer explicitly closes it by seeking to place that we want to read next, and reseting lexer.
Field Summary |
---|
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
JavaTextPane.DocumentReader(AbstractDocument document)
Construct a reader on given document. |
Method Summary | |
---|---|
void |
close()
Has no effect. |
void |
mark(int readAheadLimit)
Save a position for reset. |
boolean |
markSupported()
This reader support mark and reset. |
int |
read()
Read a single character. |
int |
read(char[] cbuf)
Read and fill buffer. |
int |
read(char[] cbuf,
int off,
int len)
Read and fill buffer. |
boolean |
ready()
Ready. |
void |
reset()
Reset this reader to last mark, or beginning of document if a mark has not been set. |
void |
seek(long n)
Seek to given position in document. |
long |
skip(long n)
Skip characters of input. |
void |
update(int position,
int adjustment)
Modifying document while reader is working is like pulling rug out from under reader. |
Methods inherited from class java.io.Reader |
---|
read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaTextPane.DocumentReader(AbstractDocument document)
document
- document to be read.Method Detail |
---|
public void update(int position, int adjustment)
position
- positionadjustment
- adjustmentpublic void close()
close
in interface Closeable
close
in class Reader
public void mark(int readAheadLimit)
mark
in class Reader
readAheadLimit
- ignored.public boolean markSupported()
markSupported
in class Reader
public int read()
read
in class Reader
public int read(char[] cbuf)
read
in class Reader
cbuf
- buffer to fill.
public int read(char[] cbuf, int off, int len)
read
in class Reader
cbuf
- buffer to fill.off
- offset into buffer to begin fill.len
- maximum number of characters to put in buffer.
public boolean ready()
ready
in class Reader
public void reset()
reset
in class Reader
public long skip(long n)
skip
in class Reader
n
- number of characters to skip.
public void seek(long n)
n
- offset to which to seek.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |