Class PrefixDumperConsole
java.lang.Object
com.singularsys.jepexamples.consoles.Console
com.singularsys.jepexamples.consoles.PrefixDumperConsole
A console application which dumps the tree representing an equation and statistics about the tree.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.singularsys.jepexamples.consoles.Console
Console.JepPrintStream, Console.SPEC_ACTION
-
Field Summary
Fields inherited from class com.singularsys.jepexamples.consoles.Console
doubleFormat, history, jep, showHistory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
sets up all the needed objects.static void
void
Print help message.processEquation
(Node node) Performs the required operation on a node.testSpecialCommands
(String command) Checks for special commands.Methods inherited from class com.singularsys.jepexamples.consoles.Console
getCommand, getPrompt, handleError, inputLoop, print, printFuns, printIntroText, println, printOps, printStdHelp, printVars, processCommand, run, setAlteredCommand, setFormat, split, toString
-
Constructor Details
-
PrefixDumperConsole
public PrefixDumperConsole()
-
-
Method Details
-
main
-
initialise
public void initialise()Description copied from class:Console
sets up all the needed objects.- Overrides:
initialise
in classConsole
-
processEquation
Description copied from class:Console
Performs the required operation on a node. Typically, evaluates the node and prints the value.- Overrides:
processEquation
in classConsole
- Parameters:
node
- Node representing expression- Returns:
- The result of the calculation
- Throws:
JepException
- if a Parse or evaluation error
-
printHelp
public void printHelp()Description copied from class:Console
Print help message. -
testSpecialCommands
Description copied from class:Console
Checks for special commands. For example a subclass may have a verbose mode switched on of off using the commandverbose on
This method can be used detected this input, perform required actions and skip normal processing by returning true.
In general subclasses should call the superclass methods to test for special commands that class implements
- Overrides:
testSpecialCommands
in classConsole
- Returns:
- SPEC_ACTION.CONTINUE - continue processing this equation, SPEC_ACTION.BREAK - stop processing this equation and get the next line of input, SPEC_ACTION.ALTERED - the input text has been altered, SPEC_ACTION.EXIT stop the program
- See Also:
-