package tcra.exercises.q3_mystery_private;

import java.util.*;
import tcra.math.*;

public class Q3MysteryExercise_PostMystery1Assertion implements
      Assertion
{
   public Q3MysteryExercise_PostMystery1Assertion() {}

   @SuppressWarnings("unchecked")
   public boolean check(List<MathType> t)
   {
      MathString<MathType> lb_self   = (MathString<MathType>)t.get(0);
      MathString<MathType> lb_b      = (MathString<MathType>)t.get(1);
      MathString<MathType> self      = (MathString<MathType>)t.get(2);
      MathString<MathType> b         = (MathString<MathType>)t.get(3);
      
      if(!self.equals(lb_self.concat(lb_b))) return false;
      
      return true;
   } // end check(List)
   
   public String toString()
   {
      return("self = |#self| * b;");
   } // end toString()

   @SuppressWarnings("unchecked")
   public String toInstanceString(List<MathType> t)
   {
      MathString<MathType> lb_self   = (MathString<MathType>)t.get(0);
      MathString<MathType> lb_b      = (MathString<MathType>)t.get(1);
      MathString<MathType> self      = (MathString<MathType>)t.get(2);
      MathString<MathType> b         = (MathString<MathType>)t.get(3);
      
      return(self.toHTMLString()+" = "+lb_self.toHTMLString()+" * "+lb_b.toHTMLString()+";");
   } // end toInstanceString(List)
} // end class
