edu.northwestern.at.utils
Class DebugUtils

java.lang.Object
  extended by edu.northwestern.at.utils.DebugUtils

public class DebugUtils
extends java.lang.Object

Debug utilities.

This static class provides various utility methods for printing debugging information.


Constructor Summary
protected DebugUtils()
          Don't allow instantiation, do allow overrides.
 
Method Summary
static java.lang.String activeThreads()
          Get list of active threads.
static java.lang.String getStackTrace(java.lang.Throwable e)
          Gets a stack trace for an exception.
static void printArray(java.lang.String arrayLabel, java.lang.Object[] array)
          Debugging support -- Print contents of an array.
static java.awt.Component printChildComponents(java.awt.Container parent, int indent)
          Prints child components of a component.
static void printMap(java.lang.String mapLabel, java.util.Map map)
          Debugging support -- Print contents of a map (HashMap, TreeMap, etc.).
static void printMemoryStatus(java.lang.String title)
          Print current memory status.
static void printNullity(java.lang.String methodName, java.lang.String objectName, java.lang.Object object)
          Debugging support -- Print message to System.out telling if object is null or not.
static void printThreads()
          Prints current thread list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugUtils

protected DebugUtils()
Don't allow instantiation, do allow overrides.

Method Detail

activeThreads

public static java.lang.String activeThreads()
Get list of active threads.

Returns:
String containing list of active threads.

getStackTrace

public static java.lang.String getStackTrace(java.lang.Throwable e)
Gets a stack trace for an exception.

Parameters:
e - The exception

printChildComponents

public static java.awt.Component printChildComponents(java.awt.Container parent,
                                                      int indent)
Prints child components of a component.

Parameters:
parent - The parent component.

printNullity

public static void printNullity(java.lang.String methodName,
                                java.lang.String objectName,
                                java.lang.Object object)
Debugging support -- Print message to System.out telling if object is null or not.

Parameters:
methodName - Name of calling method.
objectName - Name of object to inspect.
object - The named object to inspect.

printMap

public static void printMap(java.lang.String mapLabel,
                            java.util.Map map)
Debugging support -- Print contents of a map (HashMap, TreeMap, etc.).

Parameters:
mapLabel - Label for map.
map - The map to print.

N.B. This method assumes both the keys and values have toString() methods.


printArray

public static void printArray(java.lang.String arrayLabel,
                              java.lang.Object[] array)
Debugging support -- Print contents of an array.

Parameters:
arrayLabel - Label for array.
array - The array to print.

N.B. This method assumes the array values have toString() methods.


printMemoryStatus

public static void printMemoryStatus(java.lang.String title)
Print current memory status.


printThreads

public static void printThreads()
Prints current thread list.