Interface Shell.Console

Enclosing class:
Shell

public static interface Shell.Console
An interface for abstracting read/write operations, allowing the Shell to work with different input/output sources, such as a standard console or a network socket.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the console's underlying resources.
    boolean
    Checks if there is another chunk to be read.
    Reads a line / block to be Interpreter from the input.
    void
    Prints any generic object to the output.
  • Method Details

    • print

      void print(Object obj)
      Prints any generic object to the output.
      Parameters:
      obj - The object to print. NOTE: It is assumed that calls to the print method are cheap, Therefore, this should probably be buffered
    • next

      String next()
      Reads a line / block to be Interpreter from the input.
      Returns:
      The line read from the input source.
    • hasNext

      boolean hasNext()
      Checks if there is another chunk to be read.
      Returns:
      true if there is a next line, false otherwise.
    • close

      void close()
      Closes the console's underlying resources.