FileDocCategorySizeDatePackage
IConsoleCommand.javaAPI DocAzureus 3.0.3.42246Tue Sep 06 06:46:52 BST 2005org.gudy.azureus2.ui.console.commands

IConsoleCommand

public abstract class IConsoleCommand extends Object
base interface for all console commands
author
Tobias Minich

Fields Summary
private final Set
commandNames
Constructors Summary
public IConsoleCommand(String[] _commandNames)

	
	  
	
		for (int i=0;i<_commandNames.length;i++){
			
			commandNames.add( _commandNames[i] );
		}
	
Methods Summary
public abstract voidexecute(java.lang.String commandName, org.gudy.azureus2.ui.console.ConsoleInput console, java.util.List arguments)
execute the command with the specified name using the specified arguments

param
commandName
param
console
param
arguments

public abstract java.lang.StringgetCommandDescriptions()
return high-level help about the commands supported by this object.

return

public java.util.SetgetCommandNames()
returns the set of command names that this command understands. eg: the 'quit' command might understand 'quit', 'q', 'bye' other commands might actually have several command names and execute different code depending upon the command name

return

		return Collections.unmodifiableSet(commandNames);
	
public java.lang.StringgetHelpExtra()
print some 'extra' help that is displayed after all of the help commands. eg: explain some options that are common to a group of commands

return

		return null;
	
public voidprintHelp(java.io.PrintStream out, java.util.List args)
do nothing by default

param
out
param
args

		out.println("No further help for this command");
	
protected final voidprintHelp(java.io.PrintStream out, java.lang.String arg)
helper method if subclasses want to print out help for a particular subcommand

param
out
param
arg

		List args;
		if( arg != null )
		{
			args = new ArrayList();
			args.add(arg);
		}
		else
			args = Collections.EMPTY_LIST;
		
		printHelp(out, args);