de.hpi.fgis.dude.util.bibtex.parser
Class LookAheadReader

java.lang.Object
  extended by de.hpi.fgis.dude.util.bibtex.parser.LookAheadReader

final class LookAheadReader
extends Object

This implementation now features a buffer. This is more efficient than relying on BufferedReader since BufferedReader is synchronized.

Author:
henkel

Constructor Summary
LookAheadReader(Reader input)
          Initializes a LookAheadReader that reads from input.
 
Method Summary
 boolean eof()
          Checks if the end-of-content was reached.
 int getColumn()
          Returns the current column.
 char getCurrent()
          Returns the current character.
 int getLine()
          Returns the current line.
 void step()
          Jumps to the next character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LookAheadReader

public LookAheadReader(Reader input)
                throws IOException
Initializes a LookAheadReader that reads from input.

Parameters:
input - The reader that is used internally.
Throws:
IOException - If an error occurs while reading.
Method Detail

step

public void step()
          throws IOException
Jumps to the next character.

Throws:
IOException - If an error occurs while reading.

getCurrent

public char getCurrent()
Returns the current character.

Returns:
The current character.

eof

public boolean eof()
Checks if the end-of-content was reached.

Returns:
true, if the end-of-content was reached; otherwise false.

getLine

public int getLine()
Returns the current line.

Returns:
The current line.

getColumn

public int getColumn()
Returns the current column.

Returns:
The current column.


Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.