org.objectweb.medor.filter.postfix
Class PostfixExpressionHelper

java.lang.Object
  |
  +--org.objectweb.medor.filter.postfix.PostfixExpressionHelper
All Implemented Interfaces:
java.lang.Cloneable, Cloneable, ExpressionHelper

public class PostfixExpressionHelper
extends java.lang.Object
implements ExpressionHelper

An implmentation of the ExpressionHeleper Interface


Constructor Summary
PostfixExpressionHelper()
           
 
Method Summary
 java.lang.Object clone()
           
 Operand evaluate(Expression[] stack, ParameterOperand[] parameters, Tuple t)
           
 void fixIndexes(QueryNode node, Expression e)
          For a given Expression used at a QueryNode, sets the index of its FieldOperands (index in the tuple resulting from the concatenation of the children QueryNode tuples).
 int getNumberOfNode(Expression e)
           
 java.lang.String[] getParameterNames(Expression e)
           
 Expression join(Expression[] stack)
           
 Expression substituteParameters(ParameterOperand[] pos, Expression e)
           
 Expression[] substituteParameters(ParameterOperand[] pos, Expression[] stack)
           
 Expression[] toStack(Expression e)
           
 java.util.ArrayList toStack(Expression e, java.util.ArrayList al)
           
 boolean verifyNoNull(Expression e)
          Checks no branch of the expression is null.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostfixExpressionHelper

public PostfixExpressionHelper()
Method Detail

toStack

public Expression[] toStack(Expression e)
                     throws ExpressionException,
                            TypingException
Specified by:
toStack in interface ExpressionHelper
ExpressionException
TypingException

join

public Expression join(Expression[] stack)
                throws ExpressionException,
                       TypingException
Specified by:
join in interface ExpressionHelper
ExpressionException
TypingException

substituteParameters

public Expression substituteParameters(ParameterOperand[] pos,
                                       Expression e)
                                throws ExpressionException,
                                       TypingException
Specified by:
substituteParameters in interface ExpressionHelper
ExpressionException
TypingException

substituteParameters

public Expression[] substituteParameters(ParameterOperand[] pos,
                                         Expression[] stack)
                                  throws ExpressionException,
                                         TypingException
Specified by:
substituteParameters in interface ExpressionHelper
ExpressionException
TypingException

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Specified by:
clone in interface Cloneable
Overrides:
clone in class java.lang.Object
java.lang.CloneNotSupportedException

fixIndexes

public void fixIndexes(QueryNode node,
                       Expression e)
Description copied from interface: ExpressionHelper
For a given Expression used at a QueryNode, sets the index of its FieldOperands (index in the tuple resulting from the concatenation of the children QueryNode tuples). It will call the setIndex method of FieldOperand.

Specified by:
fixIndexes in interface ExpressionHelper
See Also:
FieldOperand

evaluate

public Operand evaluate(Expression[] stack,
                        ParameterOperand[] parameters,
                        Tuple t)
                 throws MedorException,
                        java.lang.IllegalStateException
Specified by:
evaluate in interface ExpressionHelper
MedorException
java.lang.IllegalStateException

toStack

public java.util.ArrayList toStack(Expression e,
                                   java.util.ArrayList al)
                            throws ExpressionException,
                                   TypingException
ExpressionException
TypingException

getNumberOfNode

public int getNumberOfNode(Expression e)
                    throws ExpressionException
ExpressionException

verifyNoNull

public boolean verifyNoNull(Expression e)
Checks no branch of the expression is null.


getParameterNames

public java.lang.String[] getParameterNames(Expression e)
                                     throws ExpressionException,
                                            TypingException
Specified by:
getParameterNames in interface ExpressionHelper
ExpressionException
TypingException