|
||||||||||
| 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)
array - the array
public static boolean isInArray(Object[] array,
Object find)
array - the arrayfind - the Object to find
public static boolean isInArray(String[] array,
String find)
array - the arrayfind - the string to find
public static boolean isInArray(int[] array,
int find)
array - the arrayfind - the int to find in the array
public static void println(String x)
x - the stringpublic static void println(Object x)
x - the objectpublic static void printArray(Object[] x)
x - the arraypublic static String printArrayToString(Object[] x)
x - the array
public static String printArrayToString(int[] x)
x - the array
public static void printArray(int[] x)
x - the array
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||