org.scopemvc.util
Class Debug

java.lang.Object
  |
  +--org.scopemvc.util.Debug

public final class Debug
extends java.lang.Object

A (very simple) general purpose Debug class for assertion checking. e.g.

 if (Debug.ON) Debug.assert(thing != null);
 if (Debug.ON) Debug.assert(thing != null, "thing is null");
 
The ON boolean is a static final so that setting it to false and rebuilding the project will strip all debug code from the binaries.

Version:
$Revision: 1.6 $ $Date: 2002/09/05 15:41:46 $
Author:
Steve Meyfroidt

Field Summary
static boolean ON
          Global debug flag to switch debug code on and off.
 
Method Summary
static void assertTrue(boolean inCondition)
          Test preconditions and postconditions like this (but don't include code in the assertion that changes the state of anything because it'll be stripped in non-debug versions):
static void assertTrue(boolean inCondition, java.lang.String inMessage)
          TODO: document the method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ON

public static final boolean ON
Global debug flag to switch debug code on and off. This must be a static final for the compiler to dead-strip all debug statements, which must be prefixed with: if (Debug.ON)

See Also:
Constant Field Values
Method Detail

assertTrue

public static void assertTrue(boolean inCondition)
Test preconditions and postconditions like this (but don't include code in the assertion that changes the state of anything because it'll be stripped in non-debug versions):
 if (Debug.ON) Debug.assert(thing != null);
 

Parameters:
inCondition - TODO: Describe the Parameter

assertTrue

public static void assertTrue(boolean inCondition,
                              java.lang.String inMessage)
TODO: document the method

Parameters:
inCondition - TODO: Describe the Parameter
inMessage - TODO: Describe the Parameter


Copyright © 2000-2002 The Scope Team. All Rights Reserved.