package tcra.exercises.resolve_preemptable_queue_private;

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

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

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

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