public class CommandWords
extends java.lang.Object
Constructor and Description |
---|
CommandWords()
Constructor - initialise the command words.
|
Modifier and Type | Method and Description |
---|---|
void |
addCommand(java.lang.String word,
Command command)
Add (or replace) a command word.
|
Command |
get(java.lang.String word)
Given a command word, find and return the matching command object.
|
java.lang.String |
showAll()
Returns a list of all valid commands.
|
public Command get(java.lang.String word)
word
- The word to look uppublic void addCommand(java.lang.String word, Command command)
word
- the word for this commandcommand
- the associated command object implementing this commandpublic java.lang.String showAll()