org.knowceans.util
Class Which

java.lang.Object
  extended by org.knowceans.util.Which

public class Which
extends java.lang.Object

Which is a debug class that provides a stacktrace at runtime

Author:
gregor

Constructor Summary
Which()
           
 
Method Summary
static java.util.List<java.lang.StackTraceElement> fullstack()
          returns a stack trace at the current point
static java.lang.String main()
          return the class that the main method was started with.
static void main(java.lang.String[] args)
           
static void setMain()
          For multithreaded applications that finish the main thread, call this method in the main() method.
static java.util.List<java.lang.String> stack()
          returns a stack trace at the current point, without package names and line numbers
static java.lang.Object thisclass(java.lang.Object t)
          short description of runtime class (with supertype if anonymous)
static java.lang.String thread()
          class that this thread was started with and the thread name
static double usedMemory()
          get the memory currently used as a double (in megabytes) rounded to two decimal digits.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Which

public Which()
Method Detail

main

public static void main(java.lang.String[] args)

fullstack

public static java.util.List<java.lang.StackTraceElement> fullstack()
returns a stack trace at the current point

Returns:

stack

public static java.util.List<java.lang.String> stack()
returns a stack trace at the current point, without package names and line numbers

Returns:

thread

public static java.lang.String thread()
class that this thread was started with and the thread name

Returns:

main

public static java.lang.String main()
return the class that the main method was started with.

FIXME: how can the calling class be determined when its main thread is. As a provisorical method, Which.setMain() is called in the main function. finished?

Returns:

setMain

public static void setMain()
For multithreaded applications that finish the main thread, call this method in the main() method. The first call to this method is kept.


thisclass

public static java.lang.Object thisclass(java.lang.Object t)
short description of runtime class (with supertype if anonymous)

Parameters:
t -
Returns:

usedMemory

public static double usedMemory()
get the memory currently used as a double (in megabytes) rounded to two decimal digits.

Returns: