Class JShell

java.lang.Object
  |
  +--JShell

public class JShell
extends java.lang.Object

The JShell class is this program's main class and is called to run the program (i.e. java JShell). All subsequent class calls and methods are executed from this class. This class includes methods for retrieving and running commands that the user interactively enters at the JShell prompt.


Constructor Summary
JShell()
          Constructs a new JShell object by initializing the field myCommands with each type of supported command.
 
Method Summary
 java.lang.String getCommand()
          Retrieves the current command inputted interactively by user.
static void main(java.lang.String[] args)
          JShell's main function - calls getCommand() and runCommand() to process and execute input line until until user ends program via "logout".
 void runCommand(java.lang.String line)
          Executes the current command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JShell

public JShell()
Constructs a new JShell object by initializing the field myCommands with each type of supported command.

Method Detail

getCommand

public java.lang.String getCommand()
Retrieves the current command inputted interactively by user.

Returns:
the current command.

runCommand

public void runCommand(java.lang.String line)
Executes the current command.

Parameters:
line - input line to be processed.

main

public static void main(java.lang.String[] args)
JShell's main function - calls getCommand() and runCommand() to process and execute input line until until user ends program via "logout".

Parameters:
args - stores command line arguments for processing.