package tcra.exercises.queue_reasoning_private;

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

public class QueuePostClearAssertion implements Assertion
{
   private MathString<MathType> empty;

   public QueuePostClearAssertion()
   {
      try
      {
         MathStringParser msp = new MathStringParser(
        		                new MathIntegerParser());
         empty                = msp.parse(new StringBuilder("<>"));
      } // end try
      catch(MathFormatException mfe) { System.out.println(mfe); }
   } // end ctor

   @SuppressWarnings("unchecked")
   public boolean check(List<MathType> l)
   {
      MathString<MathType> self = (MathString<MathType>)l.get(1);

      if(empty.equals(self)) return true;
      return false;
   } // end check(List)

   public String toString()
   {
      return "(self = &lt &gt)";
   } // end toString()

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