net.esper.eql.expression
Class AliasNodeSwapper

java.lang.Object
  extended by net.esper.eql.expression.AliasNodeSwapper

public class AliasNodeSwapper
extends java.lang.Object

A utility class for replacing select-clause aliases with their definitions in expression node trees.


Constructor Summary
AliasNodeSwapper()
           
 
Method Summary
static ExprNode swap(ExprNode exprTree, java.lang.String alias, ExprNode fullExpr)
          Replace all instances of the node representing the alias with the full expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AliasNodeSwapper

public AliasNodeSwapper()
Method Detail

swap

public static ExprNode swap(ExprNode exprTree,
                            java.lang.String alias,
                            ExprNode fullExpr)
Replace all instances of the node representing the alias with the full expression.

Parameters:
exprTree - - the expression node tree to make the changes in
alias - - the select-clause alias that is to be expanded
fullExpr - - the full expression that the alias represents
Returns:
exprTree with the appropriate swaps performed, or fullExpr, if all of exprTree needed to be swapped