Class BasicIO

  • All Implemented Interfaces:
    IOInterface

    public class BasicIO
    extends Object
    implements IOInterface

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

    • Constructor Detail

      • BasicIO

        public BasicIO()
    • Method Detail

      • setPrintStream

        public void setPrintStream​(PrintStream printStream)
      • setInputStream

        public void setInputStream​(InputStream inputStream)
      • print

        public void print​(Object x)
        Description copied from interface: IOInterface
        Print the string representation of an object, without a carriage return.
        Specified by:
        print in interface IOInterface
      • println

        public void println​(Object x)
        Description copied from interface: IOInterface
        Print the string representation of an object with a carriage return.
        Specified by:
        println in interface IOInterface
      • flush

        public void flush()
        Description copied from interface: IOInterface
        Flush anything waiting to be printed. Normally this is done with the print methods.
        Specified by:
        flush in interface IOInterface
      • clearQueue

        public void clearQueue()
        Description copied from interface: IOInterface
        Some implementations will have a queue e.g. if the user paste text from the clipboard). The IOInterface.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.
        Specified by:
        clearQueue in interface IOInterface
      • isQueueEmpty

        public boolean isQueueEmpty()
        Description copied from interface: IOInterface
        Check if the queue is empty.
        Specified by:
        isQueueEmpty in interface IOInterface
        Returns:
      • setBufferingOn

        public void setBufferingOn​(boolean bufferOn)
        Description copied from interface: IOInterface
        If this object supports buffering of commands, this will toggle it. Buffering means that every result of IOInterface.readline(String) will be stored and up down arrows will cycle through them.
        Specified by:
        setBufferingOn in interface IOInterface
      • isBufferingOn

        public boolean isBufferingOn()
        Description copied from interface: IOInterface
        return current state of buffering.
        Specified by:
        isBufferingOn in interface IOInterface
        Returns: