|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectParser
public class Parser
This class is the main class of the "World of Zuul" application. "World of Zuul" is a very simple, text based adventure game. This parser reads user input and tries to interpret it as an "Adventure" command. Every time it is called it reads a line from the terminal and tries to interpret the line as a two word command. It returns the command as an object of class Command. The parser has a set of known command words. It checks user input against the known commands, and if the input is not one of the known commands, it returns a command object that is marked as an unknown command.
Field Summary | |
---|---|
private CommandWords |
commands
|
Constructor Summary | |
---|---|
Parser()
|
Method Summary | |
---|---|
Command |
getCommand()
|
void |
showCommands()
Print out a list of valid command words. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private CommandWords commands
Constructor Detail |
---|
public Parser()
Method Detail |
---|
public Command getCommand()
public void showCommands()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |