isql.builder
Class ExpressionStack

java.lang.Object
  extended by isql.builder.ExpressionStack

public class ExpressionStack
extends java.lang.Object

Keeps track of all expressions that are parents or ancestors of the current expression. With it we can check if, for example, the current expression is parameter of a function or it a top level expression in the select part of the query. It is immutable.

Author:
SHZ Nov 5, 2007

Constructor Summary
ExpressionStack()
           
 
Method Summary
 ExpressionStack add(ExpressionBuilderTypes toAdd)
          Builds a new stack with the content of this plus the new element
 boolean contains(ExpressionBuilderTypes parent)
          Checks if one of the ancestors of the current expression has this type (FUNCTION,..,)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionStack

public ExpressionStack()
Method Detail

add

public ExpressionStack add(ExpressionBuilderTypes toAdd)
Builds a new stack with the content of this plus the new element

Parameters:
toAdd - the element to add to the stack
Returns:
the expression stack resulting from the combination of the old one plus the new element

contains

public boolean contains(ExpressionBuilderTypes parent)
Checks if one of the ancestors of the current expression has this type (FUNCTION,..,)

Parameters:
parent - the type of expression that has to be checked
Returns:
true if the stack contains that expression type