org.gudy.azureus2.ui.console.commands
Class CommandCollection

java.lang.Object
  extended by org.gudy.azureus2.ui.console.commands.CommandCollection

public class CommandCollection
extends java.lang.Object

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

Author:
pauld

Constructor Summary
CommandCollection()
           
 
Method Summary
 void add(IConsoleCommand command)
          adds the specified console command as a subcommand to this object.
 void execute(java.lang.String commandName, ConsoleInput ci, java.util.List args)
          determines the appropriate subcommand to execute and then executes it, passing in the arguments that we received
 IConsoleCommand get(java.lang.String commandName)
          returns the sub command with the specified command name
 java.lang.String getCommandDescriptions()
          constructs a string with the descriptions of all of the subcommands, each separated by a newline
 java.util.Iterator iterator()
          gets the set of IConsoleCommand objects that are all of the subcommands that this object owns
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandCollection

public CommandCollection()
Method Detail

execute

public void execute(java.lang.String commandName,
                    ConsoleInput ci,
                    java.util.List args)
determines the appropriate subcommand to execute and then executes it, passing in the arguments that we received

Parameters:
commandName -
ci -
args -

getCommandDescriptions

public java.lang.String getCommandDescriptions()
constructs a string with the descriptions of all of the subcommands, each separated by a newline

Returns:

get

public IConsoleCommand get(java.lang.String commandName)
returns the sub command with the specified command name

Parameters:
commandName -
Returns:

add

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

Parameters:
command -

iterator

public java.util.Iterator iterator()
gets the set of IConsoleCommand objects that are all of the subcommands that this object owns

Returns: