|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javatools.administrative.CallStack
public class CallStack
This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools).
It is licensed under the Creative Commons Attribution License
(see http://creativecommons.org/licenses/by/3.0) by
the YAGO-NAGA team (see http://mpii.de/yago-naga).
This class represents the current position of a program, i.e. the stack of methods that
have been called together with the line numbers.
Example:
public class Blah { public m2() { System.out.println(new CallStack()); // (1) System.out.println(CallStack.here()); // (2) } public m1() { m2(); } public static void main(String[] args) { m1(); } } --> Blah.main(12)->Blah.m1(8)->Blah.m2(2) // Call Stack at (1) Blah.m2(3) // Method and line number at (2)
Constructor Summary | |
---|---|
CallStack()
Constructs a call stack from the current program position (without the constructor call) |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Returns TRUE if the two call stacks have the same elements |
java.util.Stack<java.lang.StackTraceElement> |
getCallstack()
Returns the callstack |
static java.lang.StackTraceElement |
here()
Gives the calling position |
static void |
main(java.lang.String[] args)
Test routine |
CallStack |
ret()
Pops the top level of this callstack, returns this callstack |
java.lang.StackTraceElement |
top()
Gives the calling position as a StackTraceElement |
java.lang.String |
toString()
Returns "method(line)->method(line)->..." |
static java.lang.String |
toString(java.lang.StackTraceElement e)
Returns a nice String for a Stacktraceelement |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CallStack()
Method Detail |
---|
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public static java.lang.String toString(java.lang.StackTraceElement e)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.StackTraceElement top()
public static java.lang.StackTraceElement here()
public java.util.Stack<java.lang.StackTraceElement> getCallstack()
public CallStack ret()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |