Package org.rapidcontext.core.proc
Class CallStack
java.lang.Object
org.rapidcontext.core.proc.CallStack
A procedure call stack. The stack contains an ordered list of the
procedures currently being called.
- Version:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbottom()
Deprecated, for removal: This API element is subject to removal in a future version.boolean
Deprecated, for removal: This API element is subject to removal in a future version.Replaced with org.rapidcontext.core.type.Procedure signature.boolean
Checks if the specified procedure exists in the call stack.int
height()
Returns the current height of the call stack.toArray()
Deprecated, for removal: This API element is subject to removal in a future version.UsetoStackTrace(int)
instead.top()
Deprecated, for removal: This API element is subject to removal in a future version.Usetop(int)
instead.top
(int offset) Returns the most recent caller from the stack.toStackTrace
(int maxSize) Returns a printable stack trace for debugging purposes.
-
Constructor Details
-
CallStack
public CallStack()Creates a new empty procedure call stack.
-
-
Method Details
-
contains
Deprecated, for removal: This API element is subject to removal in a future version.Replaced with org.rapidcontext.core.type.Procedure signature.Checks if the specified procedure exists in the call stack.- Parameters:
proc
- the procedure definition- Returns:
- true if the procedure exists in the call stack, or false otherwise
-
contains
Checks if the specified procedure exists in the call stack.- Parameters:
proc
- the procedure definition- Returns:
- true if the procedure exists in the call stack, or false otherwise
-
height
public int height()Returns the current height of the call stack.- Returns:
- the current height of the call stack
-
bottom
Deprecated, for removal: This API element is subject to removal in a future version.Usetop(int)
with stack height instead.Returns the bottom procedure in the stack, i.e. the first procedure in the call chain.- Returns:
- the bottom procedure in the stack, or null if the stack is empty
-
top
Deprecated, for removal: This API element is subject to removal in a future version.Usetop(int)
instead.Returns the top procedure in the stack, i.e. the last procedure in the call chain.- Returns:
- the top procedure in the stack, or null if the stack is empty
-
top
Returns the most recent caller from the stack.- Parameters:
offset
- the offset from the top (0 for top)- Returns:
- the top caller in the stack, or null if the stack is empty
-
toArray
Deprecated, for removal: This API element is subject to removal in a future version.UsetoStackTrace(int)
instead.Returns all procedures on the stack in an array.- Returns:
- an array with all the procedures on the stack
-
toStackTrace
Returns a printable stack trace for debugging purposes.- Parameters:
maxSize
- the maximum stack trace length- Returns:
- an array with all the procedures on the stack
-
top(int)
with stack height instead.