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