| java.lang.Object java.io.Reader net.sourceforge.squirrel_sql.plugins.syntax.oster.DocumentReader
DocumentReader | class DocumentReader extends Reader (Code) | | 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.
|
Method Summary | |
public void | close() Has no effect. | public void | mark(int readAheadLimit) Save a position for reset. | public boolean | markSupported() This reader support mark and reset. | public int | read() Read a single character. | public int | read(char[] cbuf) Read and fill the buffer.
This method will always fill the buffer unless the end of the document is reached.
Parameters: cbuf - the buffer to fill. | public int | read(char[] cbuf, int off, int len) Read and fill the buffer.
This method will always fill the buffer unless the end of the document is reached.
Parameters: cbuf - the buffer to fill. Parameters: off - offset into the buffer to begin the fill. Parameters: len - maximum number of characters to put in the buffer. | public boolean | ready() | public void | reset() Reset this reader to the last mark, or the beginning of the document if a mark has not been set. | public void | seek(long n) Seek to the given position in the document. | public long | skip(long n) Skip characters of input.
This method will always skip the maximum number of characters unless
the end of the file is reached.
Parameters: n - number of characters to skip. | public void | update(int position, int adjustment) Modifying the document while the reader is working is like
pulling the rug out from under the reader. |
DocumentReader | public DocumentReader(AbstractDocument document)(Code) | | Construct a reader on the given document.
Parameters: document - the document to be read. |
close | public void close()(Code) | | Has no effect. This reader can be used even after
it has been closed.
|
mark | public void mark(int readAheadLimit)(Code) | | Save a position for reset.
Parameters: readAheadLimit - ignored. |
markSupported | public boolean markSupported()(Code) | | This reader support mark and reset.
true |
read | public int read()(Code) | | Read a single character.
the character or -1 if the end of the document has been reached. |
read | public int read(char[] cbuf)(Code) | | Read and fill the buffer.
This method will always fill the buffer unless the end of the document is reached.
Parameters: cbuf - the buffer to fill. the number of characters read or -1 if no more characters are available in the document. |
read | public int read(char[] cbuf, int off, int len)(Code) | | Read and fill the buffer.
This method will always fill the buffer unless the end of the document is reached.
Parameters: cbuf - the buffer to fill. Parameters: off - offset into the buffer to begin the fill. Parameters: len - maximum number of characters to put in the buffer. the number of characters read or -1 if no more characters are available in the document. |
ready | public boolean ready()(Code) | | true |
reset | public void reset()(Code) | | Reset this reader to the last mark, or the beginning of the document if a mark has not been set.
|
seek | public void seek(long n)(Code) | | Seek to the given position in the document.
Parameters: n - the offset to which to seek. |
skip | public long skip(long n)(Code) | | Skip characters of input.
This method will always skip the maximum number of characters unless
the end of the file is reached.
Parameters: n - number of characters to skip. the actual number of characters skipped. |
update | public void update(int position, int adjustment)(Code) | | Modifying the document while the reader is working is like
pulling the rug out from under the reader. Alerting the
reader with this method (in a nice thread safe way, this
should not be called at the same time as a read) allows
the reader to compensate.
|
|
|