re
Class Util

java.lang.Object
  extended by re.Util

public class Util
extends Object

A few useful utility messages for doing the following:

Feel free to add other utility routines to this class as well.


Field Summary
static boolean debug
          Set this to true to print out messages with the debug() methods.
 
Constructor Summary
Util()
           
 
Method Summary
static void assertTrue(boolean test, String message)
          Test whether a condition is true, and fail with a message if it is not.
static void assertTrue(boolean test, String format, Object... args)
          Test whether a condition is true, and fail with a message if it is not.
static void debug(String message)
          Print a message to the terminal, if debugging messages has been enabled by setting debug.
static void debug(String format, Object... args)
          Print a message to the terminal using printf-style arguments, if debugging messages has been enabled by setting debug.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug
Set this to true to print out messages with the debug() methods. Otherwise, those methods do nothing.

Constructor Detail

Util

public Util()
Method Detail

assertTrue

public static void assertTrue(boolean test,
                              String message)
Test whether a condition is true, and fail with a message if it is not. Alternatively, use the Java 1.5 assert statement and run Java wit the -ea option.


assertTrue

public static void assertTrue(boolean test,
                              String format,
                              Object... args)
Test whether a condition is true, and fail with a message if it is not. Alternatively, use the Java 1.5 assert statement and run Java wit the -ea option.

This version takes printf-style arguments to make formatting easier. See PrintStream.printf(String, Object...) for more details.


debug

public static void debug(String message)
Print a message to the terminal, if debugging messages has been enabled by setting debug.


debug

public static void debug(String format,
                         Object... args)
Print a message to the terminal using printf-style arguments, if debugging messages has been enabled by setting debug.

See PrintStream.printf(String, Object...) for more details.