Methods Summary |
---|
public void | add(IConsoleCommand command)adds the specified console command as a subcommand to this object.
we will therefore respond to all of the subcommands command names
when passed as the first argument to this command
for (Iterator iter = command.getCommandNames().iterator(); iter.hasNext();) {
String cmdName = (String) iter.next();
subCommands.put(cmdName, command);
}
|
public void | execute(java.lang.String commandName, org.gudy.azureus2.ui.console.ConsoleInput ci, java.util.List args)determines the appropriate subcommand to execute and then
executes it, passing in the arguments that we received
IConsoleCommand command = get(commandName);
command.execute(commandName, ci, args);
|
public IConsoleCommand | get(java.lang.String commandName)returns the sub command with the specified command name
return (IConsoleCommand) subCommands.get(commandName);
|
public java.lang.String | getCommandDescriptions()constructs a string with the descriptions of all of the subcommands,
each separated by a newline
StringWriter sw = new StringWriter();
PrintWriter out = new PrintWriter(sw);
for (Iterator iter = iterator(); iter.hasNext();) {
IConsoleCommand cmd = (IConsoleCommand) iter.next();
out.println(cmd.getCommandDescriptions());
}
return sw.toString();
|
public java.util.Iterator | iterator()gets the set of IConsoleCommand objects that are all
of the subcommands that this object owns
return new HashSet(subCommands.values()).iterator();
|