Package com.singularsys.jep
Class PrintVisitor.NullPrintVisitor
java.lang.Object
com.singularsys.jep.PrintVisitor
com.singularsys.jep.PrintVisitor.NullPrintVisitor
- All Implemented Interfaces:
JepComponent,ParserVisitor,Serializable
- Enclosing class:
PrintVisitor
A do-nothing version of a PrintVisitor for reducing memory usage.
- Since:
- 3.5
- Author:
- Richard Morris
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.singularsys.jep.PrintVisitor
PrintVisitor.NullPrintVisitor, PrintVisitor.PrintRulesI, PrintVisitor.StdElePrintRule, PrintVisitor.StdListPrintRule -
Field Summary
Fields inherited from class com.singularsys.jep.PrintVisitor
COMPLEX_I, format, fp, FULL_BRACKET, FunctionArgSep, FunLBracket, FunRBracket, LBracket, mode, NULL_PRINT_VISITOR, ot, RBracket, sb, specialFunRules, specialRules, specialVarName -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSpecialRule(Operator op, PrintVisitor.PrintRulesI rule) Adds a special print rule to be added for a given operator.voidaddSpecialRule(String funName, PrintVisitor.PrintRulesI rule) Adds a special print rule to be added for a given function.addSpecialVarName(String oldName, String newName) Allows a replacement for a specific variable nameReturns thisgetSpecialFunRule(String key) Finds the special rule, if any, associated with an operator.getSpecialRule(Operator key) Finds the special rule, if any, associated with an operator.getSpecialVarName(String key) Finds the replacement string, if any, associated with a variable.voidInitialize the component.Methods inherited from class com.singularsys.jep.PrintVisitor
append, formatValue, formatValue, getFunArgSep, getFunLBracket, getFunRBracket, getLBracket, getMaxLen, getMode, getMode, getRBracket, print, print, printBrackets, println, println, printNoBrackets, printWrap, setFunArgSep, setFunLBracket, setFunRBracket, setLBracket, setMaxLen, setMode, setNumberFormat, setRBracket, testLeft, testMid, testRight, toString, visit, visit, visit, visit, visit, visitBinary, visitNaryBinary, visitUnary
-
Method Details
-
init
Description copied from interface:JepComponentInitialize the component. This method is called whenever a component is added to Jep. Hence, it allows components to keep track of the other components they may rely on.- Specified by:
initin interfaceJepComponent- Overrides:
initin classPrintVisitor- Parameters:
jep- the current Jep instance
-
getLightWeightInstance
Returns this- Specified by:
getLightWeightInstancein interfaceJepComponent- Overrides:
getLightWeightInstancein classPrintVisitor- Returns:
- either a new instance, null or 'this'.
-
addSpecialRule
Description copied from class:PrintVisitorAdds a special print rule to be added for a given operator.- Overrides:
addSpecialRulein classPrintVisitor- Parameters:
op- the operator the rule applies torule- the print rule to use
-
addSpecialRule
Description copied from class:PrintVisitorAdds a special print rule to be added for a given function.- Overrides:
addSpecialRulein classPrintVisitor- Parameters:
funName- name of functionrule- the print rule to use
-
getSpecialRule
Description copied from class:PrintVisitorFinds the special rule, if any, associated with an operator.- Overrides:
getSpecialRulein classPrintVisitor- Parameters:
key- the Operator- Returns:
- the rule or null, if there is no special rule
-
getSpecialFunRule
Description copied from class:PrintVisitorFinds the special rule, if any, associated with an operator.- Overrides:
getSpecialFunRulein classPrintVisitor- Parameters:
key- name of the function- Returns:
- the rule or null, if there is no special rule
-
getSpecialVarName
Description copied from class:PrintVisitorFinds the replacement string, if any, associated with a variable.- Overrides:
getSpecialVarNamein classPrintVisitor- Parameters:
key- of the variable- Returns:
- the name or null, if there is no special name
-
addSpecialVarName
Description copied from class:PrintVisitorAllows a replacement for a specific variable name- Overrides:
addSpecialVarNamein classPrintVisitor- Parameters:
oldName- name of variable to replacenewName- string to print as replacement
-