|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.garret.consus.Assert
Class for checking program invariants. Analog of C assert()
macro. The Java compiler doesn't provide information about compiled
file and line number, so the place of assertion failure can be located only
by analyzing the stack trace of the thrown AssertionFailed exception.
AssertionFailed
Constructor Summary | |
---|---|
Assert()
|
Method Summary | |
---|---|
static void |
failed()
Throw assertion failed exception. |
static void |
failed(java.lang.String description)
Throw assertion failed exception with given description. |
static void |
that(boolean cond)
Check specified condition and raise AssertionFailed
exception if it is not true. |
static void |
that(java.lang.String description,
boolean cond)
Check specified condition and raise AssertionFailed
exception if it is not true. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Assert()
Method Detail |
---|
public static final void failed()
public static final void failed(java.lang.String description)
public static final void that(boolean cond)
AssertionFailed
exception if it is not true.
cond
- result of checked conditionpublic static final void that(java.lang.String description, boolean cond)
AssertionFailed
exception if it is not true.
description
- string describing checked conditioncond
- result of checked condition
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |