All Packages Class Hierarchy This Package Previous Next Index

Interface org.jfouffa.parser.html.Reader

public interface Reader
The input stream for the Parser


Method index

 o close()
Close the stream.
 o getColumn()
Returns the current column number.
 o getLine()
Returns the current line number.
 o gotoMark()
Go to the last mark() call Any call to pushback function show invalid this call.
 o mark()
Mark the current position of the stream.
 o peek()
Peek a character in the stream.
 o pushback(char)
Push back a chacracter into the stream.
 o pushback(String)
Push back a string into the stream.
 o read()
Read a single character.
 o see()
DEBUG

Methods

 o read
 public abstract int read() throws IOException
Read a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached.

Subclasses that intend to support efficient single-character input should override this method.

Returns:
The character read, as an integer in the range 0 to 16383 (0x00-0xffff), or -1 if the end of the stream has been reached
Throws: IOException
If an I/O error occurs
 o peek
 public abstract int peek() throws IOException
Peek a character in the stream.

Returns:
The character read, as an integer in the range 0 to 16383 (0x00-0xffff), or -1 if the end of the stream has been reached
Throws: IOException
If an I/O error occurs
 o pushback
 public abstract void pushback(String s)
Push back a string into the stream.

Parameters:
s - the string to push back.
 o pushback
 public abstract void pushback(char c)
Push back a chacracter into the stream.

Parameters:
c - the character to push back.
 o getLine
 public abstract int getLine()
Returns the current line number.

Returns:
the current line number
 o getColumn
 public abstract int getColumn()
Returns the current column number.

Returns:
the current column number.
 o close
 public abstract void close() throws IOException
Close the stream. Once a stream has been closed, further read(), ready(), mark(), or reset() invocations will throw an IOException. Closing a previously-closed stream, however, has no effect.

Throws: IOException
If an I/O error occurs
 o mark
 public abstract void mark() throws IOException
Mark the current position of the stream.

 o gotoMark
 public abstract void gotoMark() throws IOException
Go to the last mark() call Any call to pushback function show invalid this call. A call to the read function can invalid this call (depends on your implements). Typically, the parser calls this function to check a small part of the stream (for example, a name followed by a semi-colon).

Throws: IOException
the last mark can't be reached or no mark set.
 o see
 public abstract void see()
DEBUG