

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: INNER  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object  +ExpressionVisualizer
Use this class to get String representations of mathematical expressions constructed of Node objects.
(operand1 operator1 operand2)
. Expressions
in parentheses can be nested, for example ((operand1 operator1 operand2) operator2 operand3)
.
Parentheses are required to determine the order of operations.
operand1 operand2 operator1
. Expressions
can be nested, for example operand1 operand2 operator1 operand3 operator2
. Parentheses
are not required because the number of operands an operator takes is known (for example, a BinaryOperator
takes exactly two parameters).
operator1 operand1 operand2
. Expressions
can be nested, for example operator1 operator2 operand1 operand2 operand3
The number of operands that an operator takes is known, so parentheses are not required.
(operator1 operand1 operand2)
. Expressions
can be nested, for example (operator1 (operator2 operand1 operand2) operand3)
.
Parentheses are required to determine an operator from an operand.All examples used in method descriptions came form the same expression tree.
Constructor Summary  
ExpressionVisualizer(Node root)
Constructs an ExpressionVisualizer. 
Method Summary  
String 
elispFix()
Returns the expression in a form fit for Elisp evaluation. 
String 
inFix()
Returns the infix representation of the expression. 
String 
postFix()
Returns the postfix representation of the expression. 
String 
preFix()
Returns the prefix representation of the expression. 
Methods inherited from class java.lang.Object 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 
public ExpressionVisualizer(Node root)
root
 The root of the expression tree you wish to see.Method Detail 
public String inFix()
(((7*3)(10/2))+(5/(3+4)))
public String postFix()
7 3 * 10 2 /  5 3 4 + / +
public String preFix()
+  * 7 3 / 10 2 / 5 + 3 4
public String elispFix()
(+ ( (* 7 3) (/ 10 2)) (/ 5 (+ 3 4)))


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: INNER  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 