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

Variable Index

 o DEBUG
A constant which, when false, causes the compiler to discards methods whose names are written with CAPITAL letters.

Constructor Index

 o Assert()

Method Index

 o POSTCOND(boolean)
Checks a postcondition.
 o postcond(boolean)
Checks a postcondition.
 o precond(boolean)
Checks a precondition.
 o PRECOND(boolean)
Checks a precondition.
 o predicate(boolean)
Checks a predicate.
 o PREDICATE(boolean)
Checks a predicate.

Variables

 o DEBUG
 public static final boolean DEBUG
A constant which, when false, causes the compiler to discards methods whose names are written with CAPITAL letters.

Constructors

 o Assert
 public Assert()

Methods

 o PRECOND
 public static void PRECOND(boolean precond_)
Checks a precondition.

Parameters:
precond_ - The value of the precondition.
 o POSTCOND
 public static void POSTCOND(boolean postcond_)
Checks a postcondition.

Parameters:
postcond_ - The value of the postcondition.
 o PREDICATE
 public static void PREDICATE(boolean predicate_)
Checks a predicate.

Parameters:
predicate_ - The value of the predicate.
 o 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.
 o 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.
 o 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