package tcra.exercises.resolve_bounded_queue_private;

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

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

   @SuppressWarnings("unchecked")
   public boolean check(List<MathType> t)
   {
      MathString<MathType> lb_self = (MathString<MathType>)t.get(0);
      
      return(lb_self.length() < 
             ResolveBoundedQueueExercise.getMaxLength());
   }

   public String toString()
   {
      return("|Q| &lt; Max_Length;");
   }
   
   @SuppressWarnings("unchecked")
   public String toInstanceString(List<MathType> t)
   {
      MathString<MathType> lb_self = (MathString<MathType>)t.get(0);
      return("|" + lb_self.toHTMLString() + "| &lt; " +
             ResolveBoundedQueueExercise.getMaxLength() + ";");
   }

}
