org.jagatoo.commands
Class CommandsRegistry<C extends Command>
java.lang.Object
org.jagatoo.commands.CommandsRegistry<C>
public abstract class CommandsRegistry<C extends Command>
- extends java.lang.Object
This is a base class for a registry of available Commands.
|
Field Summary |
protected java.util.HashMap<java.lang.String,C> |
commandsMap
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
commandsMap
protected final java.util.HashMap<java.lang.String,C extends Command> commandsMap
CommandsRegistry
public CommandsRegistry()
addCommand
protected void addCommand(C command)
getCommandID
public final int getCommandID(Command command)
- Parameters:
command -
- Returns:
- the ID assotiated with the given
Command.
getCommandByID
public final Command getCommandByID(int commandID)
- Parameters:
commandID -
- Returns:
- the Command assotiated with the given commandID.
values
public final java.lang.Object[] values()
valueOf
public final C valueOf(java.lang.String key)
parseCommand
public final C parseCommand(java.lang.String str)