com.compomics.util.io
Class PushBackStringReader

java.lang.Object
  extended by com.compomics.util.io.PushBackStringReader

public class PushBackStringReader
extends Object

This class implements a PushBackReader for Strings which allows the reading of entire lines as well as the pushing back of entire lines.
Little more functionality is present at this time.

Author:
Lennart Martens

Constructor Summary
PushBackStringReader(String aSource)
          This constructor requires the passing of a String from which to construct the PushBackStringReader.
 
Method Summary
 String readLine()
          This method reads a line of text from the buffer.
 void unreadLine()
          This method 'unreads' a line of text from the Buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PushBackStringReader

public PushBackStringReader(String aSource)
This constructor requires the passing of a String from which to construct the PushBackStringReader.

Parameters:
aSource - String to construct the PushBackStringReader from.
Method Detail

readLine

public String readLine()
This method reads a line of text from the buffer. It returns a 'null' if the EOF is encountered.

Returns:
String with the current line in the buffer, or 'null' if the end of the buffer has been reached.

unreadLine

public void unreadLine()
This method 'unreads' a line of text from the Buffer.



Copyright © 2011. All Rights Reserved.