Class Shell

java.lang.Object
  extended byShell

public class Shell
extends Object

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:
7

Constructor Summary
Shell(Juno system, User user, Terminal console)
          Construct a login shell for the given user and console.
 
Method Summary
 Terminal 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.
 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
 

Constructor Detail

Shell

public Shell(Juno system,
             User user,
             Terminal console)
Construct a login shell for the given user and console.

Parameters:
system - a reference to the Juno system.
user - the User logging in.
console - a Terminal for input and output.
Method Detail

getConsole

public Terminal 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.

setDot

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

Parameters:
dot - the new working directory.