|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.jhu.cs.cisst.algorithms.optimize.fmg.util.Contract
public final class Contract
Some minimal support for "design by contract".
| Constructor Summary | |
|---|---|
Contract()
|
|
| Method Summary | |
|---|---|
static void |
post(boolean condition,
java.lang.String msg)
check if postcondition is met and throw exception if not. |
static void |
pre(boolean condition,
java.lang.String msg)
check if precondition is met and throw exception if not. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Contract()
| Method Detail |
|---|
public static void pre(boolean condition,
java.lang.String msg)
condition - the precondition that must be metmsg - if the condition is not met an object of class PreconditionNotMetException is thrown with the
message "A precondition was not met: " + msg + ".".
PreconditionNotMetException - if condition is not true
public static void post(boolean condition,
java.lang.String msg)
condition - the postcondition that must be metmsg - if the condition is not met an object of class PostconditionNotMetException is thrown with the
message "A postcondition was not met: " + msg + ".".
PostconditionNotMetException - if condition is not true
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||