tribble.io
Interface LineInputStreamI

All Known Implementing Classes:
LineInputStream

public interface LineInputStreamI

Generic text line input stream interface.

This interface is used to implement any kind of input stream that is capable of reading a single line of text 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; or such a stream could be used as the underlying input stream for a character-based input stream, such as the CharInputStreamI interface.

It is recommended that classes that implement this interface provide a constructor taking a java.io.Reader or java.io.InputStream argument.

    class MyLineInputStream
        implements tribble.io.LineInputStreamI
    {
        // Constructor
        public MyLineInputStream(java.io.Reader in)
        { ... }
    } 

This interface is similar to the standard java.io.LineNumberReader class.

Since:
2001-04-22
Version:
$Revision: 1.3 $ $Date: 2003/09/06 19:01:43 $
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:
CharInputStreamI, LexerI

Field Summary
static java.lang.String REV
          Revision information.
 
Method Summary
 void close()
          Close the input stream.
 TextLineI readLine()
          Read the next text line from the input stream.
 

Field Detail

REV

static final java.lang.String REV
Revision information.

See Also:
Constant Field Values
Method Detail

close

void close()
Close the input stream.

Since:
1.1, 2001-04-22

readLine

TextLineI readLine()
                   throws java.io.IOException
Read the next text line from the input stream.

Returns:
The next text line read from the input stream, or null if there are no more lines to read (i.e., the end of file was reached).
Throws:
java.io.IOException - Thrown if an I/O (read) error occurs.
Since:
1.1, 2001-04-22