|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecttcra.math.MethodContract
public abstract class MethodContract
Representation of a method's formal contract.
| Field Summary | |
|---|---|
protected java.util.Vector<MethodArgument> |
args
|
protected java.lang.String |
name
|
protected Assertion |
postcondition
|
protected Assertion |
precondition
|
protected ProgrammingType |
returnType
|
| Constructor Summary | |
|---|---|
protected |
MethodContract(java.lang.String name)
|
| Method Summary | |
|---|---|
abstract boolean |
check(java.lang.String[] l)
Returns whether the supplied values hold to the precondition and postcondition using the Assertions' check method. It is recommended that the parsed input is saved in a private variable of any extending class for use in the toInstanceString method. |
java.util.List<MethodArgument> |
getArgs()
Returns the list of arguments required by this method. |
java.lang.String |
getMethodName()
Returns the signature of the method being tested. |
Assertion |
getPostcondition()
Returns the postconditional Assertion. |
Assertion |
getPrecondition()
Returns the preconditional Assertion. |
ProgrammingType |
getReturnType()
Returns the programming type of what is returned from this method. |
abstract java.lang.String |
toInstanceString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String name
protected Assertion precondition
protected Assertion postcondition
protected java.util.Vector<MethodArgument> args
protected ProgrammingType returnType
| Constructor Detail |
|---|
protected MethodContract(java.lang.String name)
| Method Detail |
|---|
public java.lang.String getMethodName()
public Assertion getPrecondition()
public Assertion getPostcondition()
public java.util.List<MethodArgument> getArgs()
public ProgrammingType getReturnType()
public abstract boolean check(java.lang.String[] l)
throws MathFormatException
l - User input obtained from the GUI. Must be parsed
by the contract to obtain the correct MathType objects
true if the user input is parsed correctly
and the values hold to the pre and postconditions.
false if the values do not hold to the
precondition and postcondition.
MathFormatException - If the parsing of the user input
goes awry.public abstract java.lang.String toInstanceString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||