Util.Structures
Class ReversePolish

java.lang.Object
  extended by Util.Structures.ReversePolish

public class ReversePolish
extends java.lang.Object


Constructor Summary
ReversePolish()
           
ReversePolish(java.lang.String s)
           
 
Method Summary
 BinaryNode<Symbol> buildTreeFromPostfix()
           
 void clear()
           
 java.util.ArrayList<Symbol> getPostfix()
           
 BinaryNode<Symbol> getRoot()
           
 java.util.ArrayList<Symbol> getTokens()
           
 void setTokens(java.util.ArrayList<Symbol> tokens)
           
 void setTokens(java.lang.String s)
           
 Phenotype toPrefixPhenotype(Phenotype phenotype)
           
 java.lang.String toPrefixString(BinaryNode<Symbol> node)
          Traverses a binary tree depth first
 java.lang.String toReversePolish()
          The method toReversePolish converts the infix expression into a reverse Polish string.
 void treeFromPostfix()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReversePolish

public ReversePolish()

ReversePolish

public ReversePolish(java.lang.String s)
Method Detail

clear

public void clear()

setTokens

public void setTokens(java.lang.String s)

setTokens

public void setTokens(java.util.ArrayList<Symbol> tokens)

getTokens

public java.util.ArrayList<Symbol> getTokens()

getRoot

public BinaryNode<Symbol> getRoot()

getPostfix

public java.util.ArrayList<Symbol> getPostfix()

toPrefixPhenotype

public Phenotype toPrefixPhenotype(Phenotype phenotype)

treeFromPostfix

public void treeFromPostfix()

buildTreeFromPostfix

public BinaryNode<Symbol> buildTreeFromPostfix()

toReversePolish

public java.lang.String toReversePolish()
The method toReversePolish converts the infix expression into a reverse Polish string.

Returns:
Return the reverse Polish string.

toPrefixString

public java.lang.String toPrefixString(BinaryNode<Symbol> node)
Traverses a binary tree depth first

Parameters:
node - node to travers
Returns:
string value of node