lapisx.util
Class Debug.Verbose

java.lang.Object
  extended bylapisx.util.Debug
      extended bylapisx.util.Debug.Verbose
Direct Known Subclasses:
Debug.Quiet, Timestamped
Enclosing class:
Debug

public static class Debug.Verbose
extends Debug

Debug object that prints all messages, exception stack traces, and checks all assertions. Useful during test and debug.

If you want to print to System.err, just use the singleton instance Debug.VERBOSE rather than constructing a new Debug.Verbose instance.


Nested Class Summary
 
Nested classes inherited from class lapisx.util.Debug
Debug.NoDebug, Debug.Quiet, Debug.Verbose
 
Field Summary
protected  PrintStream out
           
 
Fields inherited from class lapisx.util.Debug
NONE, QUIET, VERBOSE
 
Constructor Summary
Debug.Verbose()
          Makes a Verbose debug object that prints to System.err.
Debug.Verbose(PrintStream out)
          Makes a Verbose debug object that prints to the given stream.
 
Method Summary
 void assertion(boolean f)
          Test an assertion (if this is enabled for assertions)
 boolean assertionEnabled()
          Test whether calling assertion() on this debug object will do anything.
 OutputStream getOutputStream()
          Returns the OutputStream associated with this debug object.
 void print(Object obj)
          Print an object (if this is enabled for printing)
 void print(String message)
          Print message (if this is enabled for printing)
 boolean printEnabled()
          Test whether calling print() or println() on this debug object will print anything.
 void println(Object obj)
          Print an object (if this is enabled for printing)
 void println(String message)
          Print message (if this is enabled for printing)
 void printStackTrace()
          Print stack trace of current execution point (if this is enabled for debugging printing)
 void printThreadInfo()
          Print a list of active threads (if this is enabled for printing)
 void report(Throwable t)
          Print the stack trace of an exception (if this is enabled for reporting exceptions)
 boolean reportEnabled()
          Test whether calling report() on this debug object will print anything.
 
Methods inherited from class lapisx.util.Debug
getDebugLevel, setDebugLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected PrintStream out
Constructor Detail

Debug.Verbose

public Debug.Verbose()
Makes a Verbose debug object that prints to System.err.


Debug.Verbose

public Debug.Verbose(PrintStream out)
Makes a Verbose debug object that prints to the given stream.

Parameters:
out - stream that will receive debugging output from this object.
Method Detail

printEnabled

public boolean printEnabled()
Description copied from class: Debug
Test whether calling print() or println() on this debug object will print anything.

Specified by:
printEnabled in class Debug
Returns:
true if print() prints, false if it's disabled.

reportEnabled

public boolean reportEnabled()
Description copied from class: Debug
Test whether calling report() on this debug object will print anything.

Specified by:
reportEnabled in class Debug
Returns:
true if report() prints, false if it's disabled.

assertionEnabled

public boolean assertionEnabled()
Description copied from class: Debug
Test whether calling assertion() on this debug object will do anything.

Specified by:
assertionEnabled in class Debug
Returns:
true if assertion() checks assertions, false if it's disabled.

print

public void print(String message)
Description copied from class: Debug
Print message (if this is enabled for printing)

Specified by:
print in class Debug
Parameters:
message - message to print

println

public void println(String message)
Description copied from class: Debug
Print message (if this is enabled for printing)

Specified by:
println in class Debug
Parameters:
message - message to print

print

public void print(Object obj)
Description copied from class: Debug
Print an object (if this is enabled for printing)

Specified by:
print in class Debug
Parameters:
obj - object to print

println

public void println(Object obj)
Description copied from class: Debug
Print an object (if this is enabled for printing)

Specified by:
println in class Debug
Parameters:
obj - object to print

report

public void report(Throwable t)
Description copied from class: Debug
Print the stack trace of an exception (if this is enabled for reporting exceptions)

Specified by:
report in class Debug
Parameters:
t - exception

printThreadInfo

public void printThreadInfo()
Description copied from class: Debug
Print a list of active threads (if this is enabled for printing)

Specified by:
printThreadInfo in class Debug

printStackTrace

public void printStackTrace()
Description copied from class: Debug
Print stack trace of current execution point (if this is enabled for debugging printing)

Specified by:
printStackTrace in class Debug

assertion

public void assertion(boolean f)
Description copied from class: Debug
Test an assertion (if this is enabled for assertions)

Specified by:
assertion in class Debug
Parameters:
f - result of assertion expression

getOutputStream

public OutputStream getOutputStream()
Description copied from class: Debug
Returns the OutputStream associated with this debug object.

Specified by:
getOutputStream in class Debug