package tcra.math;

import java.util.List;
import java.util.Vector;

/**
 * TCRAExercise represents the formal specification of an interface.
 *
 * @param interfaceName Name of the interface
 * @param contracts     List of method contracts in this interface
 */
public abstract class TCRAExercise
{
   protected String                 interfaceName;
   protected Vector<MethodContract> contracts;

   protected TCRAExercise(String name)
   {
      interfaceName = name;
      contracts = new Vector<MethodContract>();
   } // end ctor

   /**
    * Returns the signature of the interface.
    *
    * @return signature of the interface
    */
   public String getInterfaceName() { return interfaceName; }

   /**
    * Returns a list of the MethodContracts this exercise contains.
    *
    * @return list of MethodContracts
    */
   public List<MethodContract> getContracts() { return contracts; }

   /**
    * Returns the mathematical model of this interface.
    *
    * @return Math model
    */
   public abstract MathModel getMathRep();

   public String getSelfString() { return "self"; }
   public String toString()      { return interfaceName; }
}
