tcra
Interface MethodContract

All Known Implementing Classes:
QueueClearContract, QueueDequeueContract, QueueEnqueueContract, QueueFrontContract, QueueLengthContract, StackClearContract, StackLengthContract, StackPopContract, StackPushContract, StackTopContract

public interface MethodContract

MethodContract


Method Summary
 java.lang.String check(java.lang.StringBuilder[] l)
          Returns whether the supplied values hold to the precondition and postcondition using the Assertions' check method.
 java.util.List<Argument> getArgs()
          Returns the list of arguments required by this method.
 java.lang.String getName()
          Returns the siganture of the method being tested.
 Assertion getPostcondition()
          Returns the postconditional Assertion.
 Assertion getPrecondition()
          Returns the preconditional Assertion.
 Argument.Type getReturnType()
          Returns the programming type of what is returned from this method.
 java.lang.String toString()
           
 java.lang.String toString(java.util.List<MathType> l)
           
 

Method Detail

getName

java.lang.String getName()
Returns the siganture of the method being tested.

Returns:
the signature of the method

getPrecondition

Assertion getPrecondition()
Returns the preconditional Assertion.

Returns:
the preconditional assertion

getPostcondition

Assertion getPostcondition()
Returns the postconditional Assertion.

Returns:
the postconditional assertion

getArgs

java.util.List<Argument> getArgs()
Returns the list of arguments required by this method.

Returns:
list of Arguments

getReturnType

Argument.Type getReturnType()
Returns the programming type of what is returned from this method.

Returns:
programming type of the return value

check

java.lang.String check(java.lang.StringBuilder[] l)
Returns whether the supplied values hold to the precondition and postcondition using the Assertions' check method.

Parameters:
l - User input obtained from the GUI. Must be parsed by the contract to obtain the correct MathType objects
Returns:
String from toString(List l) if the values supplied for the arguments of the method satisfy both the precondition and postcondition.
"unparsable_argument" is returned if an error occurs during parsing of the input.
"null_argument" is returned if any input string is null.
null is returned if the input does not satisfy the precondition and postcondition

toString

java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

java.lang.String toString(java.util.List<MathType> l)