package tcra.exercises.resolve_bounded_queue_private;

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

public class ResolveBoundedQueue_PostClearAssertion implements
      Assertion
{
   protected MathString<MathType> empty;
   
   public ResolveBoundedQueue_PostClearAssertion()
   {
      MathStringParser msp = new MathStringParser(
                             new MathIntegerParser());
      try { empty = msp.parse(new StringBuilder("<>")); }
      catch(MathFormatException mfe) {/* Should never happen */}
   } // end ctor

   @SuppressWarnings("unchecked")
   public boolean check(List<MathType> t)
   {
      MathString<MathType> self = (MathString<MathType>)t.get(1);
      return(empty.equals(self));
   } // end check(List)
   
   public String toString() { return("Q = &lt;&gt;"); }

   @SuppressWarnings("unchecked")
   public String toInstanceString(List<MathType> t)
   {
      MathString<MathType> self = (MathString<MathType>)t.get(1);
      return(self.toHTMLString() + " = &lt;&gt;");
   } // end toInstanceString(List)
} // end class
