jwutil.util
Class Assert

java.lang.Object
  extended by jwutil.util.Assert

public abstract class Assert
extends java.lang.Object

Includes methods for an assertion mechanism. When an assertion fails, it drops into the debugger (in native mode) or just exits (in hosted mode).

Version:
$Id: Assert.java 2069 2004-12-10 09:41:32Z joewhaley $
Author:
John Whaley

Nested Class Summary
static interface Assert.DebugDelegate
           
static class Assert.DefaultDebugDelegate
           
 
Field Summary
static Assert.DebugDelegate _debug
           
 
Constructor Summary
Assert()
           
 
Method Summary
static void _assert(boolean b)
          Assert that the given predicate is true.
static void _assert(boolean b, java.lang.String reason)
          Assert that the given predicate is true.
static void TODO()
          Print a TODO message and drop into the debugger (in native mode) or just exit (in hosted mode).
static void TODO(java.lang.String s)
          Print a TODO message and drop into the debugger (in native mode) or just exit (in hosted mode).
static void UNREACHABLE()
          Print an UNREACHABLE message and drop into the debugger (in native mode) or just exit (in hosted mode).
static void UNREACHABLE(java.lang.String s)
          Print an UNREACHABLE message and drop into the debugger (in native mode) or just exit (in hosted mode).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_debug

public static Assert.DebugDelegate _debug
Constructor Detail

Assert

public Assert()
Method Detail

_assert

public static void _assert(boolean b)
Assert that the given predicate is true. If it is false, we drop into the debugger (in native mode) or just exit (in hosted mode).

Parameters:
b - predicate to check

_assert

public static void _assert(boolean b,
                           java.lang.String reason)
Assert that the given predicate is true. If it is false, we print the given reason and drop into the debugger (in native mode) or just exit (in hosted mode).

Parameters:
b - predicate to check
reason - string to print if the assertion fails

TODO

public static void TODO(java.lang.String s)
Print a TODO message and drop into the debugger (in native mode) or just exit (in hosted mode).

Parameters:
s - message to print

TODO

public static void TODO()
Print a TODO message and drop into the debugger (in native mode) or just exit (in hosted mode).


UNREACHABLE

public static void UNREACHABLE(java.lang.String s)
Print an UNREACHABLE message and drop into the debugger (in native mode) or just exit (in hosted mode).

Parameters:
s - message to print

UNREACHABLE

public static void UNREACHABLE()
Print an UNREACHABLE message and drop into the debugger (in native mode) or just exit (in hosted mode).



Copyright © 2004-2008 SUIF Compiler Group. All Rights Reserved.