Class Command

java.lang.Object
  |
  +--Command
Direct Known Subclasses:
Cat, Cd, Date, Dirs, Echo, Head, Ls, Popd, Printenv, Pushd, Pwd, Setenv, Sort, Tail, Unsetenv, Wc

public abstract class Command
extends java.lang.Object

The Command class serves as the abstract base class for each of the commands. This class includes methods for executing the current command, returning the name of a command, and expanding the arguments of a command to include specified variables, if any.


Constructor Summary
Command()
           
 
Method Summary
abstract  java.lang.String execute(java.lang.String args)
          Executes the current command and returns the result in the form of a String object.
 java.lang.String ExpandArgs(java.lang.String a)
          Expands the arguments of a command to include variables (if any) specified by the character '$' and returns the resulting expanded argument.
abstract  java.lang.String getDescription()
          Returns a description of the command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Command

public Command()
Method Detail

execute

public abstract java.lang.String execute(java.lang.String args)
Executes the current command and returns the result in the form of a String object.

Parameters:
args - arguments of the current command.
Returns:
the string result of executing the current command.

getDescription

public abstract java.lang.String getDescription()
Returns a description of the command.

Returns:
the name of the command.

ExpandArgs

public java.lang.String ExpandArgs(java.lang.String a)
Expands the arguments of a command to include variables (if any) specified by the character '$' and returns the resulting expanded argument.

Parameters:
a - the arguments to be expanded.
Returns:
expanded argument.