|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.jangaroo.jooc.Debug
public final class Debug
A class to provide debug facilities in java.
ForassertTrue, to avoid evaluation of the boolean expression with
debugging turned off on sun's java interpreter and with sun's javac use the
following:
Debug.assertTrue(Debug.enabled && anExpression, "error message");
The short-cut semantics of '&&' will guarantee that anExpression will not be
evaluated if enabled is set to false.
Debug.print also won't print its argument if Debug.enabled is false. If
the generation of the argument is already costly, you have to wrap it in an if-statement.
| Field Summary | |
|---|---|
static boolean |
enabled
|
| Method Summary | |
|---|---|
static void |
assertTrue(boolean b,
String s)
|
static boolean |
isInArray(int[] array,
int find)
Method to use to assert that an array contains an int. |
static boolean |
isInArray(Object[] array,
Object find)
Method to use to assert that an array contains an object. |
static boolean |
isInArray(String[] array,
String find)
Method to use to assert that an array contains a String. |
static boolean |
isSorted(int[] array)
Method to use to assert that an array is sorted |
static void |
printArray(int[] x)
Print an Array. |
static void |
printArray(Object[] x)
Print an Array. |
static String |
printArrayToString(int[] x)
Print an int Array to a String. |
static String |
printArrayToString(Object[] x)
Print an Object Array to a String. |
static void |
println(Object x)
Print an Object, and then finish the line. |
static void |
println(String x)
Print a String, and then finish the line. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean enabled
| Method Detail |
|---|
public static void assertTrue(boolean b,
String s)
public static boolean isSorted(int[] array)
public static boolean isInArray(Object[] array,
Object find)
public static boolean isInArray(String[] array,
String find)
public static boolean isInArray(int[] array,
int find)
public static void println(String x)
public static void println(Object x)
public static void printArray(Object[] x)
public static String printArrayToString(Object[] x)
public static String printArrayToString(int[] x)
public static void printArray(int[] x)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||