All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class calypso.util.ShellCommand

java.lang.Object
   |
   +----calypso.util.ShellCommand

public abstract class ShellCommand
extends Object
This is the base class for shell commands. A new command is defined by extending this class, implementing the execute() method and registering it to a Shell.

Version:
$Reveision: $
Author:
Juhana Räsänen
See Also:
Shell

Variable Index

 o longHelp
This should be the full description of the command.
 o shortHelp
This should be a one-line description of the command.

Constructor Index

 o ShellCommand()
Constructs a new command with default descriptions: "(no description)" for the one-line description and null string for the full description.
 o ShellCommand(String)
Constructs a new command with given short description.
 o ShellCommand(String, String)
Constructs a new command with given description texts.

Method Index

 o execute(StringTokenizer, Shell)
Executes the command.

Variables

 o shortHelp
 String shortHelp
This should be a one-line description of the command. Printed by the (default) help command of the Shell.

 o longHelp
 String longHelp
This should be the full description of the command. Printed by the (default) help command of the Shell when the name of this command is gicen as a parameter.

Constructors

 o ShellCommand
 public ShellCommand(String shortHelp_,
                     String longHelp_)
Constructs a new command with given description texts.

Parameters:
shortHelp_ - a one-line description
longHeml_ - the full description
 o ShellCommand
 public ShellCommand(String shortHelp_)
Constructs a new command with given short description.

Parameters:
shortHelp_ - a one-line description
 o ShellCommand
 public ShellCommand()
Constructs a new command with default descriptions: "(no description)" for the one-line description and null string for the full description.

Methods

 o execute
 public abstract void execute(StringTokenizer parameters_,
                              Shell shell_)
Executes the command. Called by the Shell when user requests execution of this command by typing in on the command line. The parameters are given in tokenized form, the command name is not included in the parameters, so parameters_.nextToken() is the first parameter.

Parameters:
parameters_ - The command line parameters
shell_ - The shell that executed this command

All Packages  Class Hierarchy  This Package  Previous  Next  Index