|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.command.CommandRegistry
Class that manages a map of all commands that are currently registered.
Every command to be registered must have a unique name. After registration
the CommandRegistry allows for look up of commands by their
name. The registration is done while creating a BaseCommand.
Please keep in mind that sometimes if your old commands are not needed
any longer or if you keep creating commands dynamically, it may be needed
to clear the CommandRegistry. Otherwise the internal hashmap
will hang on to the references of its commands forever.
| Constructor Summary | |
CommandRegistry()
Constructs a new CommandRegistry-Instance. |
|
| Method Summary | |
void |
clear()
Removes all commands from this Registry-Instance. |
boolean |
contains(java.lang.String key)
Returns true, if this instance contains the given key. |
void |
dump()
Dumps out the internally used map. |
BaseCommand |
get(java.lang.String id)
Looks up an command in the map and returns it, null if none
is found with the given key. |
BaseCommand |
remove(java.lang.String key)
Removes the specified mapping with key key. |
int |
size()
Returns the number of registered commands. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CommandRegistry()
CommandRegistry-Instance.
| Method Detail |
public BaseCommand get(java.lang.String id)
null if none
is found with the given key.
id - the unique id of the command to look up.
null if
there is no such command.public BaseCommand remove(java.lang.String key)
key.
key - the key whose mapping is to be removed from the registry.
null if there was no mapping for that key.public void clear()
Registry-Instance.
public int size()
public void dump()
public boolean contains(java.lang.String key)
true, if this instance contains the given key.
key - the key to check.
true, if this instance contains the given key.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||