tribble.io
Interface CharInputStreamI

All Known Implementing Classes:
CharInputStreamDfl, LineToCharInputStream

public interface CharInputStreamI

Generic character input stream.

This interface is used to implement any kind of input stream that is capable of reading a single character at a time. Such a stream can be used to read the underlying source text for a lexical analyzer (lexer), such as the LexerI interface.

Since:
2001-04-16
Version:
$Revision: 1.2 $ $Date: 2003/01/25 18:39:20 $
Author:
David R. Tribble, david@tribble.com.
Copyright ©2001-2003 by David R. Tribble, all rights reserved.
Permission is granted to freely use and distribute this source code provided that the original copyright and authorship notices remain intact.
See Also:
CharInputStreamDfl, LexerI

Field Summary
static java.lang.String REV
          Revision information.
 
Method Summary
 void close()
          Closes the input stream.
 int readChar()
          Reads the next character from the input stream.
 void setInput(java.io.Reader in)
          Establishes the input stream from which to read characters.
 

Field Detail

REV

static final java.lang.String REV
Revision information.

See Also:
Constant Field Values
Method Detail

setInput

void setInput(java.io.Reader in)
Establishes the input stream from which to read characters.

Parameters:
in - The input stream from which to read characters.
Since:
1.1, 2001-04-16

close

void close()
Closes the input stream.

Since:
1.1, 2001-04-16

readChar

int readChar()
             throws java.io.IOException
Reads the next character from the input stream.

Returns:
The next character code read from the input stream, or -1 if there are no more characters to read (i.e., the end of the input stream was reached).
Throws:
java.io.IOException - Thrown if an I/O (read) error occurs.
Since:
1.1, 2001-04-16