|
Platypus | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pz.platypus.CommandTable
public class CommandTable
Table of all supported commands in Platypus. It's implemented using a key consisting of the command root (a String that is long enough to uniquely identify the command). All commands in the Platypus file are looked up in here; Command object that is returned contains all the info for parsing the command.
| Field Summary | |
|---|---|
protected java.util.HashMap<java.lang.String,Commandable> |
commandTable
the hashtable into which the commands are loaded |
private GDD |
gdd
|
| Constructor Summary | |
|---|---|
CommandTable()
This constructor is included here only because it facilitates writing mock Literals class for testing. |
|
CommandTable(GDD Gdd)
|
|
| Method Summary | |
|---|---|
void |
add(Commandable entry)
add a Commandable item to the hash table, using its root as the key to the entry |
Commandable |
getCommand(java.lang.String root)
Lookup a command by its root |
void |
load()
Load the commands and symbols into the command table. |
void |
loadCommand(java.lang.String root,
java.lang.String attrib)
adds an individual command from the property file into the Platypus parser command table |
(package private) PropertyFile |
loadCommandFile(java.lang.String commandFilename)
Opens and reads the property file containing the commands |
(package private) void |
loadCommands(java.lang.String commandFilename)
load commands in to the command table |
(package private) int |
loadCommandsFromFile(PropertyFile pf)
Loads the commands from the property file into the command table |
(package private) void |
loadRemainingCommands()
Family commands are not generally load-able from the property file; so they have to be loaded manually, as done here. |
(package private) void |
loadSymbols()
load symbols and special characters. |
(package private) PropertyFile |
readCommandFile(java.lang.String filename)
Read a property file listing commands to load into the Platy parser command table |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.HashMap<java.lang.String,Commandable> commandTable
private GDD gdd
| Constructor Detail |
|---|
public CommandTable()
public CommandTable(GDD Gdd)
| Method Detail |
|---|
public void load()
void loadCommands(java.lang.String commandFilename)
commandFilename - the file from which to read the commandsvoid loadRemainingCommands()
PropertyFile loadCommandFile(java.lang.String commandFilename)
commandFilename - the name of the file to open and read
PropertyFile readCommandFile(java.lang.String filename)
filename - file with the commands
int loadCommandsFromFile(PropertyFile pf)
pf - the property file to load from
public void loadCommand(java.lang.String root,
java.lang.String attrib)
root - the key for the commandattrib - the command attributes, that specify the command type and other attributesvoid loadSymbols()
public void add(Commandable entry)
entry - to be added (either a command or a symbol)public Commandable getCommand(java.lang.String root)
root - command root (portion ending in the first | : or ] character
|
Platypus | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||