package tcra.exercises.resolve_bounded_queue_private;

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

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

   @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          dequ    = (MathInteger)t.get(3);
      
      return(lb_self.equals(self.prepend(dequ)));
   } // end check(List)

   public String toString() { return("#Q = &lt;I&gt; * Q;"); }
   
   @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          dequ    = (MathInteger)t.get(3);
      
      return(lb_self.toHTMLString() + " = &lt;" +
             dequ.toHTMLString() + "&gt; * " +
             self.toHTMLString());
   } // end toInstanceString(List)
} // end class
