|
J avolution v5.2 (J2SE 1.5+) | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.Reader
javolution.io.CharSequenceReader
public final class CharSequenceReader
This class allows any CharSequence to be used as
a reader.
| Field Summary |
|---|
| Fields inherited from class java.io.Reader |
|---|
lock |
| Constructor Summary | |
|---|---|
CharSequenceReader()
Creates a new character sequence reader for which the character sequence input is not set. |
|
| Method Summary | |
|---|---|
void |
close()
Closes and resets this reader for reuse. |
int |
read()
Reads a single character. |
void |
read(java.lang.Appendable dest)
Reads characters into the specified appendable. |
int |
read(char[] cbuf,
int off,
int len)
Reads characters into a portion of an array. |
boolean |
ready()
Indicates if this stream is ready to be read. |
void |
reset()
Resets the internal state of this object to its default values. |
CharSequenceReader |
setInput(java.lang.CharSequence charSequence)
Sets the character sequence to use for reading. |
| Methods inherited from class java.io.Reader |
|---|
mark, markSupported, read, read, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CharSequenceReader()
setInput(java.lang.CharSequence)| Method Detail |
|---|
public CharSequenceReader setInput(java.lang.CharSequence charSequence)
charSequence - the character sequence to be read.
java.lang.IllegalStateException - if this reader is being reused and
it has not been closed or reset.
public boolean ready()
throws java.io.IOException
ready in class java.io.Readertrue if this reader has remaining characters to
read; false otherwise.
java.io.IOException - if an I/O error occurs.public void close()
resets this reader for reuse.
close in interface java.io.Closeableclose in class java.io.Reader
public int read()
throws java.io.IOException
-1
is returned if the end of the character sequence input has been reached.
read in class java.io.Readerjava.io.IOException - if an I/O error occurs (e.g. incomplete
character sequence being read).
public int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
read in class java.io.Readercbuf - the destination buffer.off - the offset at which to start storing characters.len - the maximum number of characters to read
java.io.IOException - if an I/O error occurs.
public void read(java.lang.Appendable dest)
throws java.io.IOException
dest - the destination buffer.
java.io.IOException - if an I/O error occurs.public void reset()
Reusable
reset in interface Reusablereset in class java.io.Reader
|
J avolution v5.2 (J2SE 1.5+) | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||