tcra.exercises
Class StackPopContract

java.lang.Object
  extended by tcra.exercises.StackPopContract
All Implemented Interfaces:
MethodContract

public class StackPopContract
extends java.lang.Object
implements MethodContract


Constructor Summary
StackPopContract()
           
 
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StackPopContract

public StackPopContract()
Method Detail

check

public java.lang.String check(java.lang.StringBuilder[] l)
Description copied from interface: MethodContract
Returns whether the supplied values hold to the precondition and postcondition using the Assertions' check method.

Specified by:
check in interface MethodContract
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

public java.lang.String toString()
Specified by:
toString in interface MethodContract
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.util.List<MathType> l)
Specified by:
toString in interface MethodContract

getName

public java.lang.String getName()
Description copied from interface: MethodContract
Returns the siganture of the method being tested.

Specified by:
getName in interface MethodContract
Returns:
the signature of the method

getPrecondition

public Assertion getPrecondition()
Description copied from interface: MethodContract
Returns the preconditional Assertion.

Specified by:
getPrecondition in interface MethodContract
Returns:
the preconditional assertion

getPostcondition

public Assertion getPostcondition()
Description copied from interface: MethodContract
Returns the postconditional Assertion.

Specified by:
getPostcondition in interface MethodContract
Returns:
the postconditional assertion

getArgs

public java.util.List<Argument> getArgs()
Description copied from interface: MethodContract
Returns the list of arguments required by this method.

Specified by:
getArgs in interface MethodContract
Returns:
list of Arguments

getReturnType

public Argument.Type getReturnType()
Description copied from interface: MethodContract
Returns the programming type of what is returned from this method.

Specified by:
getReturnType in interface MethodContract
Returns:
programming type of the return value