Class PushBackStringReader

java.lang.Object
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 Details

    • PushBackStringReader

      public PushBackStringReader()
      Empty default constructor
    • 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 Details

    • 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.