public class CallStack
extends java.lang.Object
| Constructor and Description |
|---|
CallStack() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<CallFrame> |
callstack()
Returns a list of call frames in this call stack.
|
void |
clear()
Removes all of the elements from this call stack.
|
CallStack |
copy() |
boolean |
isEmpty()
Returns
true if this call stack contains no elements. |
CallFrame |
peek()
Retrieves, but does not remove, the head of the call stack
or returns
null if this call stack is empty. |
CallFrame |
pop()
Pops an frame from the call stack.
|
void |
push(CallFrame frame)
Pushes a frame onto the call stack.
|
java.util.List<java.lang.String> |
toList()
Returns a list of stringified call frames in this call stack.
|
java.lang.String |
toString() |
public void push(CallFrame frame)
frame - the frame to pushjava.lang.NullPointerException - if the specified frame is nullpublic CallFrame pop()
null if this
if this call stack is emptypublic CallFrame peek()
null if this call stack is empty.null if this
if this call stack is emptypublic boolean isEmpty()
true if this call stack contains no elements.true if this call stack contains no elementspublic void clear()
public CallStack copy()
public java.util.List<java.lang.String> toList()
pop()).
The head element will be stored at index 0 in the list.public java.util.List<CallFrame> callstack()
pop()).
The head element will be stored at index 0 in the list.public java.lang.String toString()
toString in class java.lang.Object