ikrs.util
Class DefaultCommandFactory

java.lang.Object
  extended by ikrs.util.AbstractCommandFactory<Command>
      extended by ikrs.util.DefaultCommandFactory
All Implemented Interfaces:
CommandFactory<Command>
Direct Known Subclasses:
ModuleCommandFactory, YuccaCommandFactory

public class DefaultCommandFactory
extends AbstractCommandFactory<Command>
implements CommandFactory<Command>


Constructor Summary
DefaultCommandFactory()
          Create a new DefaultCommandFactory with an empty set of supported commands.
 
Method Summary
protected  void addSupportedCommand(Command c)
           
 java.util.Set<Command> getSupportedCommands()
          Get a set of all supported commands.
 Command make(java.lang.String name, BasicType[] params)
          Make a new Command with the given name and params.
 
Methods inherited from class ikrs.util.AbstractCommandFactory
getParentFactory, make, make, parse, setParentFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ikrs.util.CommandFactory
getParentFactory, make, parse, setParentFactory
 

Constructor Detail

DefaultCommandFactory

public DefaultCommandFactory()
Create a new DefaultCommandFactory with an empty set of supported commands.

Method Detail

addSupportedCommand

protected void addSupportedCommand(Command c)

make

public Command make(java.lang.String name,
                    BasicType[] params)
             throws UnknownCommandException,
                    CommandStringIncompleteException
Make a new Command with the given name and params.

Specified by:
make in interface CommandFactory<Command>
Specified by:
make in class AbstractCommandFactory<Command>
Parameters:
name - The command's name.
params - The command's params - in BasicType representation.
Returns:
The new command.
Throws:
UnknownCommandException
CommandStringIncompleteException

getSupportedCommands

public java.util.Set<Command> getSupportedCommands()
Get a set of all supported commands. This is usually a set of the commands that are understood by this factory plus all commands that are understood by all parent factories (if exist).

Specified by:
getSupportedCommands in interface CommandFactory<Command>
Specified by:
getSupportedCommands in class AbstractCommandFactory<Command>
Returns:
A set containting all commands that are supported by this factory.