package tcra.exercises.resolve_deque_private;

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

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

   @SuppressWarnings("unchecked")
   public boolean check(List<MathType> t)
   {
      MathString<MathType> lb_self = (MathString<MathType>)t.get(0);
      MathString<MathType> self    = (MathString<MathType>)t.get(2);
      MathInteger          eject   = (MathInteger)t.get(3);
      
      return(lb_self.equals(self.concat(eject)));
   } // end check(List)

   public String toString()
   {
      return("#Q = Q * &lt;I&gt;;");
   } // end toString()
   
   @SuppressWarnings("unchecked")
   public String toInstanceString(List<MathType> t)
   {
      MathString<MathType> lb_self = (MathString<MathType>)t.get(0);
      MathString<MathType> self    = (MathString<MathType>)t.get(2);
      MathInteger          eject   = (MathInteger)t.get(3);
      
      return(lb_self.toHTMLString()+" = "+self.toHTMLString()+
             " * &lt;"+eject.toHTMLString()+"&gt;;");
   } // end toInstanceString(List)
} // end class
