finiteAutomata
Class Assert

java.lang.Object
  extended by finiteAutomata.Assert

public class Assert
extends java.lang.Object

Provides basic assertion testing for pre-conditions.

An assertion is a condition that is expected to be true at a certain point in the code. Selective testing of method pre-conditions should reduce programming errors and simplify debugging.

Version:
Fall 2007
Author:
Barbara Wahl (adapted from Duane A. Bailey's code)

Constructor Summary
Assert()
           
 
Method Summary
static void pre(boolean test, java.lang.String message)
          Performs a verification of the condition, and does nothing if the condition holds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Assert

public Assert()
Method Detail

pre

public static void pre(boolean test,
                       java.lang.String message)
Performs a verification of the condition, and does nothing if the condition holds.

Parameters:
test - a boolean expression for the condition to be tested
message - an English description of the condition
Postcondition:
Performs a verification of the condition, and does nothing if the condition holds. If the condition fails, the assertion throws an exception and prints the associated message, describing the condition that failed.