org.hawk.ds
Class BinaryTree

java.lang.Object
  extended by org.hawk.ds.BinaryTree

public class BinaryTree
extends java.lang.Object

This creates a binary tree from the input string

See Also:
Element, Expression, Variable, DoubleDataType, VarTypeEnum

Nested Class Summary
static class BinaryTree.Node
          This represents the node of the binary tree.
 
Constructor Summary
BinaryTree(java.lang.String str)
          Initializes a newly created BinaryTree object.
 
Method Summary
 IScript calculate()
           
 IScript calculate(BinaryTree.Node toor)
           
 boolean createTree()
          Creates the binary tree from the infix expression.
 Expression getInfixExpression()
           
 java.lang.String getInputExpression()
           
 IScript getOutput()
          This returns the output of the binary tree.
static void main(java.lang.String[] args)
           
 void setInfixExpression(Expression infixExpression)
           
 void setInputExpression(java.lang.String inputExpression)
           
 void showTree()
           
 void showTree(int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryTree

public BinaryTree(java.lang.String str)
           throws HawkException
Initializes a newly created BinaryTree object.

Throws:
HawkException
Method Detail

getInfixExpression

public Expression getInfixExpression()

setInfixExpression

public void setInfixExpression(Expression infixExpression)

getInputExpression

public java.lang.String getInputExpression()

setInputExpression

public void setInputExpression(java.lang.String inputExpression)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

createTree

public boolean createTree()
                   throws HawkException
Creates the binary tree from the infix expression.

Throws:
HawkException

getOutput

public IScript getOutput()
This returns the output of the binary tree.

Returns:
returns the output of the binary tree.

showTree

public void showTree()

showTree

public void showTree(int length)

calculate

public IScript calculate()
                  throws HawkException
Throws:
HawkException

calculate

public IScript calculate(BinaryTree.Node toor)
                  throws HawkException
Throws:
HawkException