Class DocumentReader
java.lang.Object
java.io.Reader
org.fife.io.DocumentReader
- All Implemented Interfaces:
Closeable, AutoCloseable, Readable
A
Reader for javax.swing.text.Document objects.- Version:
- 1.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()This currently does nothing...voidmark(int readAheadLimit) Marks the present position in the stream.booleanTells whether this reader supports themarkoperation.intread()Reads the single character at the current position in the document.intread(char[] array) Readarray.lengthcharacters from the beginning of the document intoarray.intread(char[] cbuf, int off, int len) Reads characters into a portion of an array.booleanready()Tells whether this reader is ready to be read without blocking for input.voidreset()Resets the stream.voidseek(long pos) Move to the specified position in the document.longskip(long n) Skips characters.Methods inherited from class Reader
nullReader, of, read, readAllAsString, readAllLines, transferTo
-
Field Details
-
position
private long positionThe stream's position in the document. -
mark
private long markA remembered position in the document. -
document
The document we're working on. -
segment
Used for fast character access.
-
-
Constructor Details
-
DocumentReader
Constructor.- Parameters:
document- The document we're 'reading'.
-
-
Method Details
-
close
-
mark
-
markSupported
public boolean markSupported()Tells whether this reader supports themarkoperation. This always returnstrueforDocumentReader.- Overrides:
markSupportedin classReader
-
read
-
read
-
read
public int read(char[] cbuf, int off, int len) Reads characters into a portion of an array. -
ready
-
reset
-
skip
-
seek
public void seek(long pos) Move to the specified position in the document. Ifposis greater than the document's length, the stream's position is moved to the end of the document.- Parameters:
pos- The position in the document to move to.
-