Interface IOInterface

  • All Known Implementing Classes:
    BasicIO, ISO6429IO, StringIO

    public interface IOInterface

    Created by Jeff Gaynor
    on 5/11/20 at 6:57 AM

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clearQueue()
      Some implementations will have a queue e.g.
      void flush()
      Flush anything waiting to be printed.
      boolean isBufferingOn()
      return current state of buffering.
      boolean isQueueEmpty()
      Check if the queue is empty.
      void print​(Object x)
      Print the string representation of an object, without a carriage return.
      void println​(Object x)
      Print the string representation of an object with a carriage return.
      String readline()
      Read a line of input with no prompt.
      String readline​(String prompt)
      read a line of input, printing the prompt (on the left) first.
      void setBufferingOn​(boolean bufferOn)
      If this object supports buffering of commands, this will toggle it.
    • Method Detail

      • readline

        String readline​(String prompt)
                 throws IOException
        read a line of input, printing the prompt (on the left) first. The prompt is not returned.
        Parameters:
        prompt -
        Returns:
        Throws:
        IOException
      • print

        void print​(Object x)
        Print the string representation of an object, without a carriage return.
        Parameters:
        x -
      • println

        void println​(Object x)
        Print the string representation of an object with a carriage return.
        Parameters:
        x -
      • flush

        void flush()
        Flush anything waiting to be printed. Normally this is done with the print methods.
      • clearQueue

        void clearQueue()
        Some implementations will have a queue e.g. if the user paste text from the clipboard). The readline(String) methods will queue these up and return them in sequence -- this is done silently. If for some reason you need only a single line and want to discard anything else, invoke this.
      • isQueueEmpty

        boolean isQueueEmpty()
        Check if the queue is empty.
        Returns:
      • setBufferingOn

        void setBufferingOn​(boolean bufferOn)
        If this object supports buffering of commands, this will toggle it. Buffering means that every result of readline(String) will be stored and up down arrows will cycle through them.
        Parameters:
        bufferOn -
      • isBufferingOn

        boolean isBufferingOn()
        return current state of buffering.
        Returns: