| java.lang.Object org.apache.xpath.VariableStack
All known Subclasses: org.apache.xpath.jaxp.JAXPVariableStack,
VariableStack | public class VariableStack implements Cloneable(Code) | | Defines a class to keep track of a stack for
template arguments and variables.
This has been changed from the previous incarnations of this
class to be fairly low level.
|
Constructor Summary | |
public | VariableStack() Constructor for a variable stack. |
Method Summary | |
public void | clearLocalSlots(int start, int len) Use this to clear the variables in a section of the stack. | public synchronized Object | clone() Returns a clone of this variable stack. | public XObject | elementAt(int i) Get the element at the given index, regardless of stackframe.
Parameters: i - index from zero. | public XObject | getGlobalVariable(XPathContext xctxt, int index) Get a global variable or parameter from the global stack frame.
Parameters: xctxt - The XPath context, which must be passed in order tolazy evaluate variables. Parameters: index - Global variable index relative to the global stackframe bottom. | public XObject | getGlobalVariable(XPathContext xctxt, int index, boolean destructiveOK) Get a global variable or parameter from the global stack frame.
Parameters: xctxt - The XPath context, which must be passed in order tolazy evaluate variables. Parameters: index - Global variable index relative to the global stackframe bottom. | public XObject | getLocalVariable(XPathContext xctxt, int index) Get a local variable or parameter in the current stack frame.
Parameters: xctxt - The XPath context, which must be passed in order tolazy evaluate variables. Parameters: index - Local variable index relative to the current stackframe bottom. | public XObject | getLocalVariable(int index, int frame) Get a local variable or parameter in the current stack frame. | public XObject | getLocalVariable(XPathContext xctxt, int index, boolean destructiveOK) Get a local variable or parameter in the current stack frame.
Parameters: xctxt - The XPath context, which must be passed in order tolazy evaluate variables. Parameters: index - Local variable index relative to the current stackframe bottom. | public int | getStackFrame() Get the position from where the search should start,
which is either the searchStart property, or the top
of the stack if that value is -1. | public XObject | getVariableOrParam(XPathContext xctxt, org.apache.xml.utils.QName qname) Get a variable based on it's qualified name.
This is for external use only.
Parameters: xctxt - The XPath context, which must be passed in order tolazy evaluate variables. Parameters: qname - The qualified name of the variable. | public boolean | isLocalSet(int index) Tell if a local variable has been set or not.
Parameters: index - Local variable index relative to the current stackframe bottom. | public int | link(int size) Allocates memory (called a stackframe) on the stack; used to store
local variables and parameter arguments.
I use the link/unlink concept because of distant
Motorola 68000 assembler memories.
Parameters: size - The size of the stack frame allocation. | public void | reset() Reset the stack to a start position. | public void | setGlobalVariable(int index, XObject val) Set a global variable or parameter in the global stack frame. | public void | setLocalVariable(int index, XObject val) Set a local variable or parameter in the current stack frame. | public void | setLocalVariable(int index, XObject val, int stackFrame) Set a local variable or parameter in the specified stack frame. | public void | setStackFrame(int sf) Set the current stack frame. | public int | size() Get size of the stack. | public void | unlink() Free up the stack frame that was last allocated with
VariableStack.link(int size) . | public void | unlink(int currentFrame) Free up the stack frame that was last allocated with
VariableStack.link(int size) . |
CLEARLIMITATION | final public static int CLEARLIMITATION(Code) | | limitation for 1K
|
_frameTop | int _frameTop(Code) | | The top of the stack frame (_stackFrames ).
|
_linksTop | int _linksTop(Code) | | The top of the links stack.
|
_stackFrames | XObject[] _stackFrames(Code) | | The stack frame where all variables and params will be kept.
|
VariableStack | public VariableStack()(Code) | | Constructor for a variable stack.
|
clearLocalSlots | public void clearLocalSlots(int start, int len)(Code) | | Use this to clear the variables in a section of the stack. This is
used to clear the parameter section of the stack, so that default param
values can tell if they've already been set. It is important to note that
this function has a 1K limitation.
Parameters: start - The start position, relative to the current local stack frame. Parameters: len - The number of slots to be cleared. |
elementAt | public XObject elementAt(int i)(Code) | | Get the element at the given index, regardless of stackframe.
Parameters: i - index from zero. The item at the given index. |
getGlobalVariable | public XObject getGlobalVariable(XPathContext xctxt, int index) throws TransformerException(Code) | | Get a global variable or parameter from the global stack frame.
Parameters: xctxt - The XPath context, which must be passed in order tolazy evaluate variables. Parameters: index - Global variable index relative to the global stackframe bottom. The value of the variable. throws: TransformerException - |
getGlobalVariable | public XObject getGlobalVariable(XPathContext xctxt, int index, boolean destructiveOK) throws TransformerException(Code) | | Get a global variable or parameter from the global stack frame.
Parameters: xctxt - The XPath context, which must be passed in order tolazy evaluate variables. Parameters: index - Global variable index relative to the global stackframe bottom. The value of the variable. throws: TransformerException - |
getLocalVariable | public XObject getLocalVariable(XPathContext xctxt, int index) throws TransformerException(Code) | | Get a local variable or parameter in the current stack frame.
Parameters: xctxt - The XPath context, which must be passed in order tolazy evaluate variables. Parameters: index - Local variable index relative to the current stackframe bottom. The value of the variable. throws: TransformerException - |
getLocalVariable | public XObject getLocalVariable(int index, int frame) throws TransformerException(Code) | | Get a local variable or parameter in the current stack frame.
Parameters: index - Local variable index relative to the givenframe bottom.NEEDSDOC @param frame The value of the variable. throws: TransformerException - |
getLocalVariable | public XObject getLocalVariable(XPathContext xctxt, int index, boolean destructiveOK) throws TransformerException(Code) | | Get a local variable or parameter in the current stack frame.
Parameters: xctxt - The XPath context, which must be passed in order tolazy evaluate variables. Parameters: index - Local variable index relative to the current stackframe bottom. The value of the variable. throws: TransformerException - |
getStackFrame | public int getStackFrame()(Code) | | Get the position from where the search should start,
which is either the searchStart property, or the top
of the stack if that value is -1.
The current stack frame position. |
isLocalSet | public boolean isLocalSet(int index) throws TransformerException(Code) | | Tell if a local variable has been set or not.
Parameters: index - Local variable index relative to the current stackframe bottom. true if the value at the index is not null. throws: TransformerException - |
link | public int link(int size)(Code) | | Allocates memory (called a stackframe) on the stack; used to store
local variables and parameter arguments.
I use the link/unlink concept because of distant
Motorola 68000 assembler memories.
Parameters: size - The size of the stack frame allocation. This ammount shouldnormally be the maximum number of variables that you can have allocatedat one time in the new stack frame. The bottom of the stack frame, from where local variable addressingshould start from. |
reset | public void reset()(Code) | | Reset the stack to a start position.
the total size of the execution stack. |
setGlobalVariable | public void setGlobalVariable(int index, XObject val)(Code) | | Set a global variable or parameter in the global stack frame.
Parameters: index - Local variable index relative to the global stack framebottom. Parameters: val - The value of the variable that is being set. |
setLocalVariable | public void setLocalVariable(int index, XObject val)(Code) | | Set a local variable or parameter in the current stack frame.
Parameters: index - Local variable index relative to the current stackframe bottom. Parameters: val - The value of the variable that is being set. |
setLocalVariable | public void setLocalVariable(int index, XObject val, int stackFrame)(Code) | | Set a local variable or parameter in the specified stack frame.
Parameters: index - Local variable index relative to the current stackframe bottom.NEEDSDOC @param stackFrame Parameters: val - The value of the variable that is being set. |
setStackFrame | public void setStackFrame(int sf)(Code) | | Set the current stack frame.
Parameters: sf - The new stack frame position. |
size | public int size()(Code) | | Get size of the stack.
the total size of the execution stack. |
unlink | public void unlink(int currentFrame)(Code) | | Free up the stack frame that was last allocated with
VariableStack.link(int size) .
Parameters: currentFrame - The current frame to set to after the unlink. |
|
|