Class ChainedConsole
java.lang.Object
com.singularsys.jepexamples.consoles.Console
com.singularsys.extexamples.consoles.ChainedConsole
A console application illustrating the chained function features
in the
com.singularsys.extensions.chained package.-
Nested Class Summary
Nested classes/interfaces inherited from class com.singularsys.jepexamples.consoles.Console
Console.JepOutputStream, Console.JepPrintStream, Console.NodeRes, Console.SPEC_ACTION -
Field Summary
Fields inherited from class com.singularsys.jepexamples.consoles.Console
altered, doubleFormat, history, jep, showHistory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanfinaliseCommand(String command, Node node, Object res) Perform any post-processing of a command after evaluation.voidsets up all the needed objects.static voidCreates a new Console object and calls run()voidPrint help message.voidPrints introductory text.processEquation(Node node) Performs the required operation on a node.voidSets the evaluator used.Methods inherited from class com.singularsys.jepexamples.consoles.Console
clearVars, getCommand, getHistory, getJep, getPrompt, handleError, inputLoop, parseEvaluate, print, printFunctionEntry, printFuns, printHistory, println, printOps, printStdHelp, printVars, processCommand, run, setAlteredCommand, setFormat, setFormat, setIndexShift, setMonitor, showCalls, showTree, split, testSpecialCommands, toString
-
Constructor Details
-
ChainedConsole
public ChainedConsole()
-
-
Method Details
-
initialise
public void initialise()Description copied from class:Consolesets up all the needed objects.- Overrides:
initialisein classConsole
-
processEquation
Description copied from class:ConsolePerforms the required operation on a node. Typically, evaluates the node and prints the value.- Overrides:
processEquationin classConsole- Parameters:
node- Node representing expression- Returns:
- The result of the calculation
- Throws:
JepException- if a Parse or evaluation error
-
finaliseCommand
Description copied from class:ConsolePerform any post-processing of a command after evaluation.- Overrides:
finaliseCommandin classConsole- Parameters:
command- the string expressionnode- parsed expressionres- result of evaluation- Returns:
- true, false indicates the program should exit.
-
printIntroText
public void printIntroText()Description copied from class:ConsolePrints introductory text.- Overrides:
printIntroTextin classConsole
-
printHelp
public void printHelp()Description copied from class:ConsolePrint help message. -
setEvaluator
Description copied from class:ConsoleSets the evaluator used. Default method simple callsJep.setComponent(com.singularsys.jep.JepComponent)with the evaluator.- Overrides:
setEvaluatorin classConsole- Parameters:
ev- the evaluator to use
-
main
Creates a new Console object and calls run()
-