|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
org.fife.io.DocumentReader
public class DocumentReader
A Reader
for javax.swing.text.Document
objects.
Field Summary |
---|
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
DocumentReader(Document document)
Constructor. |
Method Summary | |
---|---|
void |
close()
This currently does nothing... |
void |
mark(int readAheadLimit)
Marks the present position in the stream. |
boolean |
markSupported()
Tells whether this reader supports the mark operation. |
int |
read()
Reads the single character at the current position in the document. |
int |
read(char[] array)
Read array.length characters from the beginning
of the document into array . |
int |
read(char[] cbuf,
int off,
int len)
Reads characters into a portion of an array. |
boolean |
ready()
Tells whether this reader is ready to be read without blocking for input. |
void |
reset()
Resets the stream. |
void |
seek(long pos)
Move to the specified position in the document. |
long |
skip(long n)
Skips characters. |
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 DocumentReader(Document document)
document
- The document we're 'reading'.Method Detail |
---|
public void close()
close
in interface Closeable
close
in class Reader
public void mark(int readAheadLimit)
reset()
will reposition the stream to this point.
mark
in class Reader
readAheadLimit
- Ignored.public boolean markSupported()
mark
operation.
This always returns true
for DocumentReader
.
markSupported
in class Reader
public int read()
read
in class Reader
public int read(char[] array)
array.length
characters from the beginning
of the document into array
.
read
in class Reader
array
- The array to read characters into.
public int read(char[] cbuf, int off, int len)
read
in class Reader
cbuf
- The destination buffer.off
- Offset at which to start storing characters.len
- Maximum number of characters to read.
-1
if the
end of the stream (document) has been reached.public boolean ready()
DocumentReader
will
always return true.
ready
in class Reader
true
if the next read operation will
return without blocking.public void reset()
reset
in class Reader
public long skip(long n)
skip
in class Reader
n
- The number of characters to skip.
public void seek(long pos)
pos
is greater than the document's length, the stream's position is moved
to the end of the document.
pos
- The position in the document to move to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |