Class Shell

java.lang.Object
  extended byShell
All Implemented Interfaces:
InterpreterInterface

public class Shell
extends Object
implements InterpreterInterface

Models a shell (command interpreter) The Shell knows the (Juno) system it's working in, the User who started it, and the console to which to send output. It keeps track of the the current working directory (.) .

Version:
10

Method Summary
 OutputInterface getConsole()
          The console associated with this Shell.
 Directory getDot()
          The current working directory for this shell.
 String getPrompt()
          The prompt for the CLI.
 Juno getSystem()
          The Juno object associated with this Shell.
 User getUser()
          The User associated with this shell.
 boolean interpret(String inputLine)
          Interpret a String.
 void setDot(Directory dot)
          Set the current working directory for this Shell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConsole

public OutputInterface getConsole()
The console associated with this Shell.

Returns:
the console.

getDot

public Directory getDot()
The current working directory for this shell.

Returns:
the current working directory.

getPrompt

public String getPrompt()
The prompt for the CLI.

Returns:
the prompt string.

getSystem

public Juno getSystem()
The Juno object associated with this Shell.

Returns:
the Juno instance that created this Shell.

getUser

public User getUser()
The User associated with this shell.

Returns:
the user.

interpret

public boolean interpret(String inputLine)
Interpret a String. Syntax
     shellcommand command-arguments
 

Specified by:
interpret in interface InterpreterInterface
Parameters:
inputLine - the String to interpret.
Returns:
true unless shell command is logout.

setDot

public void setDot(Directory dot)
Set the current working directory for this Shell.

Parameters:
dot - the new working directory.