corejava
Class Assertion

java.lang.Object
  |
  +--corejava.Assertion

public class Assertion
extends java.lang.Object

A class for assertion checking


Inner Class Summary
static interface Assertion.Failure
          A class for reporting assertion failures
 
Constructor Summary
Assertion()
           
 
Method Summary
static void check(boolean b)
          Check an assertion
static void check(boolean b, java.lang.String s)
          Check an assertion
static void check(double x)
          Check an assertion
static void check(double x, java.lang.String s)
          Check an assertion
static void check(long x)
          Check an assertion
static void check(long x, java.lang.String s)
          Check an assertion
static void check(java.lang.Object obj)
          Check an assertion
static void check(java.lang.Object obj, java.lang.String s)
          Check an assertion
static void main(java.lang.String[] args)
          test stub
static void setCheck(boolean c)
          Turn checking on or off
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Assertion

public Assertion()
Method Detail

check

public static void check(boolean b,
                         java.lang.String s)
Check an assertion
Parameters:
b - the condition to check
s - a string describing the check
Throws:
Assertion.Failure - if condition not true

check

public static void check(boolean b)
Check an assertion
Parameters:
b - the condition to check
Throws:
Assertion.Failure - if condition not true

check

public static void check(java.lang.Object obj,
                         java.lang.String s)
Check an assertion
Parameters:
obj - an object to check
s - a string describing the check
Throws:
Assertion.Failure - if object is null

check

public static void check(java.lang.Object obj)
Check an assertion
Parameters:
obj - an object to check
Throws:
Assertion.Failure - if object is null

check

public static void check(double x,
                         java.lang.String s)
Check an assertion
Parameters:
x - a number
s - a string describing the check
Throws:
Assertion.Failure - if number is 0

check

public static void check(double x)
Check an assertion
Parameters:
x - a number
Throws:
Assertion.Failure - if number is 0

check

public static void check(long x,
                         java.lang.String s)
Check an assertion
Parameters:
x - a number
s - a string describing the check
Throws:
Assertion.Failure - if number is 0

check

public static void check(long x)
Check an assertion
Parameters:
x - a number
Throws:
Assertion.Failure - if number is 0

setCheck

public static void setCheck(boolean c)
Turn checking on or off
Parameters:
c - true to turn checking on, false to turn checking off

main

public static void main(java.lang.String[] args)
test stub