org.hawk.ds
Class Expression

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

public class Expression
extends java.lang.Object

This represents the input

See Also:
Element

Constructor Summary
Expression(java.util.List<Element> elements)
          CTOR considering the type as well.
 
Method Summary
 java.util.List<Element> getExpression()
           
static void main(java.lang.String[] args)
           
 void setExpression(java.util.List<Element> expression)
           
 java.util.List<Element> toPostfix()
          This returns the the POSTFIX form of the input expression.
 java.util.List<Element> toPrefix()
          This converts the input expression into PREFIX format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Expression

public Expression(java.util.List<Element> elements)
CTOR considering the type as well. Allowed type being INFIX,POSTFIX AND PREFIX.

Parameters:
elements -
type -
Method Detail

getExpression

public java.util.List<Element> getExpression()

setExpression

public void setExpression(java.util.List<Element> expression)

main

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

toPrefix

public java.util.List<Element> toPrefix()
                                 throws HawkException
This converts the input expression into PREFIX format.

Returns:
returns the prefix format of the input expression.
Throws:
HawkException

toPostfix

public java.util.List<Element> toPostfix()
                                  throws HawkException
This returns the the POSTFIX form of the input expression.

Returns:
returns the POSTFIX form of the input expression.
Throws:
HawkException