Javolution 6.0.0 java
|
Public Member Functions | |
CharSequenceReader () | |
CharSequenceReader | setInput (CharSequence charSequence) |
boolean | ready () throws IOException |
void | close () |
int | read () throws IOException |
int | read (char cbuf[], int off, int len) throws IOException |
void | read (Appendable dest) throws IOException |
void | reset () |
Private Attributes | |
CharSequence | _input |
int | _index |
This class allows any CharSequence
to be used as a reader.
Definition at line 25 of file CharSequenceReader.java.
javolution.io.CharSequenceReader.CharSequenceReader | ( | ) |
Creates a new character sequence reader for which the character sequence input is not set.
Definition at line 43 of file CharSequenceReader.java.
void javolution.io.CharSequenceReader.close | ( | ) |
Closes and resets this reader for reuse.
Definition at line 76 of file CharSequenceReader.java.
References javolution.io.CharSequenceReader._input, and javolution.io.CharSequenceReader.reset().
int javolution.io.CharSequenceReader.read | ( | ) | throws IOException |
Reads a single character. This method does not block, -1
is returned if the end of the character sequence input has been reached.
IOException | if an I/O error occurs (e.g. incomplete character sequence being read). |
Definition at line 91 of file CharSequenceReader.java.
References javolution.io.CharSequenceReader._index, and javolution.io.CharSequenceReader._input.
void javolution.io.CharSequenceReader.read | ( | Appendable | dest | ) | throws IOException |
Reads characters into the specified appendable. This method does not block.
dest | the destination buffer. |
IOException | if an I/O error occurs. |
Definition at line 144 of file CharSequenceReader.java.
References javolution.io.CharSequenceReader._input.
int javolution.io.CharSequenceReader.read | ( | char | cbuf[], |
int | off, | ||
int | len | ||
) | throws IOException |
Reads characters into a portion of an array. This method does not block.
cbuf | the destination buffer. |
off | the offset at which to start storing characters. |
len | the maximum number of characters to read |
IOException | if an I/O error occurs. |
Definition at line 108 of file CharSequenceReader.java.
References javolution.io.CharSequenceReader._index, javolution.io.CharSequenceReader._input, javolution.text.CharArray.array(), javolution.text.TextBuilder.getChars(), javolution.text.Text.getChars(), javolution.lang.MathLib.min(), and javolution.text.CharArray.offset().
boolean javolution.io.CharSequenceReader.ready | ( | ) | throws IOException |
Indicates if this stream is ready to be read.
true
if this reader has remaining characters to read; false
otherwise. IOException | if an I/O error occurs. |
Definition at line 67 of file CharSequenceReader.java.
References javolution.io.CharSequenceReader._input.
void javolution.io.CharSequenceReader.reset | ( | ) |
Definition at line 151 of file CharSequenceReader.java.
References javolution.io.CharSequenceReader._index, and javolution.io.CharSequenceReader._input.
Referenced by javolution.io.CharSequenceReader.close().
CharSequenceReader javolution.io.CharSequenceReader.setInput | ( | CharSequence | charSequence | ) |
Sets the character sequence to use for reading.
charSequence | the character sequence to be read. |
Definition at line 53 of file CharSequenceReader.java.
References javolution.io.CharSequenceReader._input.
|
private |
Holds the current index into the character sequence.
Definition at line 35 of file CharSequenceReader.java.
Referenced by javolution.io.CharSequenceReader.read(), and javolution.io.CharSequenceReader.reset().
|
private |
Holds the character sequence input.
Definition at line 30 of file CharSequenceReader.java.
Referenced by javolution.io.CharSequenceReader.close(), javolution.io.CharSequenceReader.read(), javolution.io.CharSequenceReader.ready(), javolution.io.CharSequenceReader.reset(), and javolution.io.CharSequenceReader.setInput().