//============================================================================== // tribble/io/CharInputStreamI.java //------------------------------------------------------------------------------ package tribble.io; // System imports import java.io.IOException; import java.io.Reader; import java.lang.String; // Local imports // (None) /******************************************************************************* * 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
* {@link tribble.io.LexerI} interface.
*
* @version $Revision: 1.2 $ $Date: 2003/01/25 18:39:20 $
* @since 2001-04-16
* @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 CharInputStreamDfl
* @see LexerI
*/
public interface CharInputStreamI
{
// Identification
/** Revision information. */
static final String REV =
"@(#)tribble/io/CharInputStreamI.java $Revision: 1.2 $ $Date: 2003/01/25 18:39:20 $\n";
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Public methods
/***************************************************************************
* Establishes the input stream from which to read characters.
*
* @param in
* The input stream from which to read characters.
*
* @since 1.1, 2001-04-16
*/
public void setInput(Reader in);
/***************************************************************************
* Closes the input stream.
*
* @since 1.1, 2001-04-16
*/
public void close();
/***************************************************************************
* Reads the next character from the input stream.
*
* @return
* 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 IOException
* Thrown if an I/O (read) error occurs.
*
* @since 1.1, 2001-04-16
*/
public int readChar()
throws IOException;
}
// End CharInputStreamI.java