ref_send API 2.17
defensive programming in Java

org.waterken.syntax
Class SourceReader

java.lang.Object
  extended by org.waterken.syntax.SourceReader

public final class SourceReader
extends java.lang.Object

A text reader that keeps track of the current line and column number, as well as the most recent character read.


Field Summary
static java.lang.String newLine
          all Unicode line terminators
 
Constructor Summary
SourceReader(java.io.Reader in)
          Constructs an instance.
 
Method Summary
 void close()
          Closes the text stream.
 int getColumn()
          Gets the column number of the head character.
 int getHead()
          Gets the last read character, or -1 for EOF.
 int getLine()
          Gets the line number of the head character.
 int read()
          Gets the next character in the stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

newLine

public static final java.lang.String newLine
all Unicode line terminators

See Also:
Constant Field Values
Constructor Detail

SourceReader

public SourceReader(java.io.Reader in)
Constructs an instance.

Parameters:
in - underlying character stream
Method Detail

getLine

public int getLine()
Gets the line number of the head character.


getColumn

public int getColumn()
Gets the column number of the head character.


getHead

public int getHead()
Gets the last read character, or -1 for EOF.


read

public int read()
         throws java.io.EOFException,
                java.io.IOException
Gets the next character in the stream.

Throws:
java.io.EOFException - attempt to read past EOF
java.io.IOException - any I/O problem

close

public void close()
           throws java.io.IOException
Closes the text stream.

Throws:
java.io.IOException - any I/O problem

ref_send API 2.17
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.