|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Reader org.devaki.nextobjects.ui.editor.DocumentReader
A reader interface for an abstract document. Since the syntax highlighting packages only accept Stings and Readers, this must be used. Since the 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 the lexer explicitly closes it by seeking to the place that we want to read next, and reseting the lexer.
Field Summary |
Fields inherited from class java.io.Reader |
lock |
Constructor Summary | |
DocumentReader(javax.swing.text.AbstractDocument pDocument)
Construct a reader on the 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 the buffer. |
int |
read(char[] cbuf,
int off,
int len)
Read and fill the buffer. |
boolean |
ready()
|
void |
reset()
Reset this reader to the last mark, or the beginning of the document if a mark has not been set. |
void |
seek(long n)
Seek to the given position in the document |
long |
skip(long n)
Skip characters of input. |
void |
update(int pPosition,
int adjustment)
Alerting the reader |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DocumentReader(javax.swing.text.AbstractDocument pDocument)
Method Detail |
public void update(int pPosition, int adjustment)
pPosition
- positionadjustment
- adjustementpublic void close()
public void mark(int readAheadLimit)
readAheadLimit
- ignored.public boolean markSupported()
public int read()
public int read(char[] cbuf)
cbuf
- the buffer to fill.
public int read(char[] cbuf, int off, int len)
cbuf
- the buffer to fill.off
- offset into the buffer to begin the fill.len
- maximum number of characters to put in the buffer.
public boolean ready()
public void reset()
public long skip(long n)
n
- number of characters to skip.
public final void seek(long n)
n
- the offset to which to seek.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |