|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Command pattern. There are several methods depending on what information
the command needs.
The way the method has of telling there has been an error is by
throwing a CommandException. This is by far not the best solution, but
the best I could think of. The main problem with this approach is that
code that call commands that don't throw exceptions are obliged to
surround the command call with a try/catch pair.
| Method Summary | |
void |
execute()
Executes the command without passing any arguments to it. |
void |
execute(Context ctx)
Executes the command only a context to it. |
void |
execute(Context ctx,
java.lang.String[] args)
Executes the command with a context and an array of strings as arguments. |
void |
execute(java.lang.String[] args)
Executes the command passing an array of strings as arguments. |
java.lang.String |
getDescription()
Returns a brief description of the command. |
| Method Detail |
public void execute()
throws CommandException
CommandException
public void execute(java.lang.String[] args)
throws CommandException
CommandException
public void execute(Context ctx)
throws CommandException
CommandException
public void execute(Context ctx,
java.lang.String[] args)
throws CommandException
CommandExceptionpublic java.lang.String getDescription()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||