isql.builder
Class ExpressionStack
java.lang.Object
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
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExpressionStack
public ExpressionStack()
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