public abstract class Command extends Object
Command is an action that can alter the state of an
Interpreter.| Modifier and Type | Field and Description |
|---|---|
protected Console |
console
Console that created this command.
|
| Constructor and Description |
|---|
Command(Console console)
Creates a command.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
execute(Interpreter interpreter)
Hook to provide various implementations of command execution.
|
protected InputStream |
getInputStream(String path)
Creates a
InputStream using path. |
public abstract void execute(Interpreter interpreter) throws Exception
interpreter - Jython interpreter that will execute the command.Exception - An error was encountered executing the command. Jython
will catch three standard Python exceptions: SyntaxError, ValueError,
and OverflowError. Other exceptions are thrown.protected InputStream getInputStream(String path) throws Exception
InputStream using path. It's here entirely for
convenience.path - Path to the desired file.path.Exception - if there was badness.