Package com.biglybt.ui.console.commands
Class CommandCollection
java.lang.Object
com.biglybt.ui.console.commands.CommandCollection
this class represents a collection of commands. it can be used by
command objects to house their subcommands. when execute() method
is called, the appropriate subcommand is looked up and executed
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(IConsoleCommand command) adds the specified console command as a subcommand to this object.void
execute
(String commandName, ConsoleInput ci, List args) determines the appropriate subcommand to execute and then executes it, passing in the arguments that we receivedreturns the sub command with the specified command nameconstructs a string with the descriptions of all of the subcommands, each separated by a newlineiterator()
gets the set of IConsoleCommand objects that are all of the subcommands that this object owns
-
Field Details
-
subCommands
-
-
Constructor Details
-
CommandCollection
public CommandCollection()
-
-
Method Details
-
execute
determines the appropriate subcommand to execute and then executes it, passing in the arguments that we received- Parameters:
commandName
-ci
-args
-
-
getCommandDescriptions
constructs a string with the descriptions of all of the subcommands, each separated by a newline- Returns:
-
get
returns the sub command with the specified command name- Parameters:
commandName
-- Returns:
-
add
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- Parameters:
command
-
-
iterator
gets the set of IConsoleCommand objects that are all of the subcommands that this object owns- Returns:
-