Class DPrintVisitor

  • All Implemented Interfaces:
    JepComponent, ParserVisitor, java.io.Serializable

    public class DPrintVisitor
    extends PrintVisitor
    An extension of PrintVisitor which will print the equations of a variable if required. The behaviours of this class is determined by two modes PRINT_PARTIAL_EQNS and PRINT_VARIABLE_EQNS. When a variable or partial derivative is encountered then its equation may be printed. By default equations for PartialDerivatives are printed but equations for normal derivatives are not. TODO might want to print eqn for y=sin(x) but not x=3
    Author:
    Rich Morris Created on 26-Feb-2004
    See Also:
    Serialized Form
    • Constructor Detail

      • DPrintVisitor

        public DPrintVisitor()
    • Method Detail

      • testLeft

        public boolean testLeft​(Operator top,
                                Node lhs)
        Description copied from class: PrintVisitor
        Test if brackets are necessary around left hand side.
        Overrides:
        testLeft in class PrintVisitor
        Parameters:
        top - The current operator being printed.
        lhs - The node on the left hand side.
        Returns:
        True if a bracket is necessary, false otherwise.
      • testMid

        public boolean testMid​(Operator top,
                               Node rhs)
        Description copied from class: PrintVisitor
        Test if brackets are needed around a middle argument x + (y) + z
        Overrides:
        testMid in class PrintVisitor
        Parameters:
        top - The current operator being printed.
        rhs - The node on the middle of a chain.
        Returns:
        True if a bracket is necessary, false otherwise.
      • testRight

        public boolean testRight​(Operator top,
                                 Node rhs)
        Description copied from class: PrintVisitor
        Tests if brackets are necessary around the RHS child of a operator.
        Overrides:
        testRight in class PrintVisitor
        Parameters:
        top - The operator.
        rhs - The right hand side node.
        Returns:
        True if brackets are necessary, false otherwise.