All Packages Class Hierarchy This Package Previous Next Index
Class calypso.util.Assert
java.lang.Object
|
+----calypso.util.Assert
- public abstract class Assert
- extends Object
An abstract helper class for assertion making.
The methods of this class are divided into two classes.
The ones in CAPITAL letters denote methods that a proper compiler
can discard when the DEBUG constant is false. These methods may be
used during the development phase to make additional checks etc.
These methods always call System.exit().
The ones in normal-size letters denote methods that should be
left in the final code version. They never call System.exit(), but
throw an exception which extends java.lang.RuntimeException, i.e.,
an exception that doesn't have to be handled by the client.
- Version:
- $Revision: 1.2 $
- Author:
- Petteri Koponen
- See Also:
- AssertException
-
DEBUG
- A constant which, when false, causes the compiler to discards
methods whose names are written with CAPITAL letters.
-
Assert()
-
-
POSTCOND(boolean)
- Checks a postcondition.
-
postcond(boolean)
- Checks a postcondition.
-
precond(boolean)
- Checks a precondition.
-
PRECOND(boolean)
- Checks a precondition.
-
predicate(boolean)
- Checks a predicate.
-
PREDICATE(boolean)
- Checks a predicate.
DEBUG
public static final boolean DEBUG
- A constant which, when false, causes the compiler to discards
methods whose names are written with CAPITAL letters.
Assert
public Assert()
PRECOND
public static void PRECOND(boolean precond_)
- Checks a precondition.
- Parameters:
- precond_ - The value of the precondition.
POSTCOND
public static void POSTCOND(boolean postcond_)
- Checks a postcondition.
- Parameters:
- postcond_ - The value of the postcondition.
PREDICATE
public static void PREDICATE(boolean predicate_)
- Checks a predicate.
- Parameters:
- predicate_ - The value of the predicate.
precond
public static void precond(boolean precond_) throws AssertException
- Checks a precondition.
- Parameters:
- precond_ - The value of the precondition.
- Throws: AssertException
- An assertion has failed.
postcond
public static void postcond(boolean postcond_) throws AssertException
- Checks a postcondition.
- Parameters:
- postcond_ - The value of the postcondition.
- Throws: AssertException
- An assertion has failed.
predicate
public static void predicate(boolean predicate_) throws AssertException
- Checks a predicate.
- Parameters:
- predicate_ - The value of the predicate.
- Throws: AssertException
- An assertion has failed.
All Packages Class Hierarchy This Package Previous Next Index