|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--bsh.CallStack
A stack of namespaces representing the call path. The top of the stack is always the current namespace of evaluation.
This is necessary to support this this.caller magic reference and will also be used to provide additional debug/tracking and error reporting information in the future.
Note: it would be awefully nice to use the java.util.Stack here. Sigh... have to stay 1.1 compatible.
Note: How can this be thread safe, you might ask? Wouldn't a thread executing various beanshell methods be mutating the callstack? Don't we need one CallStack per Thread in the interpreter? The answer is that we do. java.lang.Thread executes our script via the Runnable interface through an external (hard) Java reference via bsh.XThis. In that case XThis creates a new CallStack for each external call...
Field Summary | |
private java.util.Vector |
stack
|
Constructor Summary | |
CallStack()
|
Method Summary | |
void |
clear()
|
int |
depth()
|
NameSpace |
get(int depth)
zero based. |
NameSpace |
pop()
|
void |
push(NameSpace ns)
|
void |
set(int depth,
NameSpace ns)
This is kind of crazy, but used by the setNameSpace command. |
NameSpace |
swap(NameSpace newTop)
Swap in the value as the new top of the stack and return the old value. |
NameSpace[] |
toArray()
|
NameSpace |
top()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.util.Vector stack
Constructor Detail |
public CallStack()
Method Detail |
public void clear()
public void push(NameSpace ns)
public NameSpace top()
public NameSpace get(int depth)
public void set(int depth, NameSpace ns)
public NameSpace pop()
public NameSpace swap(NameSpace newTop)
public int depth()
public NameSpace[] toArray()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |