|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Assert
A class that acts like the C/C++ assertion macro.
For a detailed description of this topic look at
http://www.afu.com/javafaq.html and search for
"11.6 How can I write C/C++ style assertions in Java?".
All assert
methods throw an AssertionException, if
the asserted condition is not true and the "Enable assertions"
checkbox was selected while creating the class from the template.
AssertionException
Field Summary | |
static boolean |
ENABLED
True if assert methods are enabled. |
Method Summary | |
static void |
assert(boolean b)
Assert that the boolean condition b is true. |
static void |
assert(boolean b,
java.lang.String s)
Assert that the boolean condition b is true. |
static void |
assert(long l)
Assert that the long parameter l is not zero. |
static void |
assert(long l,
java.lang.String s)
Assert that the long parameter l is not zero. |
static void |
assert(java.lang.Object ref)
Assert that the object reference l is not
null . |
static void |
assert(java.lang.Object ref,
java.lang.String s)
Assert that the object reference l is not
null . |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final boolean ENABLED
Method Detail |
public static final void assert(boolean b)
b
is true.b
- The boolean condition to check.public static final void assert(boolean b, java.lang.String s)
b
is true.b
- The boolean condition to check.s
- The detail message for the resulting exception.public static final void assert(long l)
l
is not zero.l
- The long value to check.public static final void assert(long l, java.lang.String s)
l
is not zero.l
- The long value to check.s
- The detail message for the resulting exception.public static final void assert(java.lang.Object ref)
l
is not
null
.ref
- The object reference to check.public static final void assert(java.lang.Object ref, java.lang.String s)
l
is not
null
.ref
- The object reference to check.s
- The detail message for the resulting exception.
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |