edu.esi.outils
Class Debug

java.lang.Object
  |
  +--edu.esi.outils.Debug

public class Debug
extends java.lang.Object

Classe d'outil pour vérifier les paramettres d'une fonction, manier les exceptions, et pour quitter la programme si il y a une erreur.


Method Summary
static void ASSERT(boolean expression, java.lang.String message)
          Assert that a programming statement is true.
static void ASSERT(java.lang.Object object)
          Same as the ASSERT(Object) method however requires no error message.
static void ASSERT(java.lang.Object object, java.lang.String message)
          Similar to the ASSERT(boolean, String) method, however asserts that the given object is not null.
static void EXCEPTION(java.lang.Exception e, java.lang.String message)
          Calls the EXIT method using the error message and e.toString().
static void EXIT(java.lang.String message)
          Print the given message to standard error, print the current stack trace and exit the program with a return value of 1.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

EXIT

public static void EXIT(java.lang.String message)
Print the given message to standard error, print the current stack trace and exit the program with a return value of 1.

ASSERT

public static void ASSERT(boolean expression,
                          java.lang.String message)
Assert that a programming statement is true. If false, the EXIT(String message) method will be called.

For example:

 Debug.ASSERT( noodleFactory.contains("Shrimp flavour"),
 	"Noodle factory does not contain shrimp flavour!");
 

ASSERT

public static void ASSERT(java.lang.Object object,
                          java.lang.String message)
Similar to the ASSERT(boolean, String) method, however asserts that the given object is not null.

ASSERT

public static void ASSERT(java.lang.Object object)
Same as the ASSERT(Object) method however requires no error message. (Faster to write code, but less informative when there is a problem).

EXCEPTION

public static void EXCEPTION(java.lang.Exception e,
                             java.lang.String message)
Calls the EXIT method using the error message and e.toString().