org.basex.query
Class QueryStack

java.lang.Object
  extended by org.basex.query.QueryStack

public class QueryStack
extends java.lang.Object

The query stack, containing local variable bindings of all active scopes.

Author:
BaseX Team 2005-12, BSD License, Leo Woerteler

Constructor Summary
QueryStack()
           
 
Method Summary
 int enterFrame(int size)
          Enters a new stack frame.
 void exitFrame(int fpt)
          Exits a stack frame and makes all bound variables eligible for garbage collection.
 Value get(Var var)
          Gets the value bound to the given variable in the current stack frame.
 void set(Var var, Value val, QueryContext ctx, InputInfo ii)
          Sets the value of the given variable in the current stack frame.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryStack

public QueryStack()
Method Detail

enterFrame

public int enterFrame(int size)
Enters a new stack frame.

Parameters:
size - size of this frame
Returns:
stack pointer of the old frame

exitFrame

public void exitFrame(int fpt)
Exits a stack frame and makes all bound variables eligible for garbage collection.

Parameters:
fpt - frame pointer of the underlying stack frame

get

public Value get(Var var)
Gets the value bound to the given variable in the current stack frame.

Parameters:
var - variable
Returns:
bound value

set

public void set(Var var,
                Value val,
                QueryContext ctx,
                InputInfo ii)
         throws QueryException
Sets the value of the given variable in the current stack frame.

Parameters:
var - variable to bind the value to
val - value to bind
ctx - query context
ii - input info
Throws:
QueryException - if the value does not have the right type

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object