package tcra.exercises.resolve_bounded_queue_private;

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

public class ResolveBoundedQueue_PostEnqueueAssertion implements
      Assertion
{
   public ResolveBoundedQueue_PostEnqueueAssertion() {}
   
   @SuppressWarnings("unchecked")
   public boolean check(List<MathType> t)
   {
      MathString<MathType> lb_self = (MathString<MathType>)t.get(0);
      MathInteger lb_enqu          = (MathInteger)t.get(1);
      MathString<MathType> self    = (MathString<MathType>)t.get(2);
      
      return(self.equals(lb_self.concat(lb_enqu)));
   } // end check(List)

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