Hilbert II - Version 0.03.01

org.qedeq.kernel.parser
Class MementoTextInput

java.lang.Object
  extended byorg.qedeq.kernel.parser.MementoTextInput

public final class MementoTextInput
extends Object

Remember TextInput positions.

Version:
$Revision: 1.1 $

Constructor Summary
MementoTextInput(TextInput input)
          Constructor.
 
Method Summary
 void clearMark()
          Forget last remembered position.
 boolean eof()
          Are there still any characters to read?
 int getChar()
          Reads a single character and does not change the reading position.
 int getColumn()
          Returns the current column number.
 String getLine()
          Returns the current line.
 long getPosition()
          Get byte position.
 int getRewindStackSize()
          Get rewind stack size.
 int getRow()
          Returns the current line number.
 void markPosition()
          Remember current position.
 int readChar()
          Reads a single character and increments the reading position by one.
 long rewindPosition()
          Rewind to previous marked position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MementoTextInput

public MementoTextInput(TextInput input)
Constructor.

Parameters:
input - Input source to parse.
Method Detail

markPosition

public void markPosition()
Remember current position.


rewindPosition

public long rewindPosition()
Rewind to previous marked position. Also clears the mark.

Returns:
Current position before pop.

clearMark

public void clearMark()
Forget last remembered position.


getPosition

public long getPosition()
Get byte position.

Returns:
Position.

getChar

public int getChar()
Reads a single character and does not change the reading position.

Returns:
character read, if there are no more chars Character.MAX_VALUE is returned

readChar

public int readChar()
Reads a single character and increments the reading position by one.

Returns:
character read, if there are no more chars Character.MAX_VALUE is returned

eof

public final boolean eof()
Are there still any characters to read?

Returns:
Anything left for reading further?

getRewindStackSize

public int getRewindStackSize()
Get rewind stack size.

Returns:
Rewind stack size.

getColumn

public int getColumn()
Returns the current column number.

Returns:
Current column number (starting with line 1).

getRow

public int getRow()
Returns the current line number.

Returns:
Current line number (starting with line 1).

getLine

public String getLine()
Returns the current line.

Returns:
Current line.

Hilbert II - Version 0.03.01

©left GNU General Public Licence
All Rights Reserved.