/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package test.dbc.stack;

/**
 *
 * @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
 * @version $Revision: 1.2.8.3 $
 * @@org.jboss.aspects.dbc.Dbc
 * @@org.jboss.aspects.dbc.Invariant ({"!$tgt.isEmpty() implies $tgt.top() != null", "$tgt.isEmpty() implies $tgt.elements.size() == 0"})
 */
public interface Stack
{
   /**
    * @@org.jboss.aspects.dbc.PreCond ({"$0 != null"})
    * @@org.jboss.aspects.dbc.PostCond ({"!$tgt.isEmpty()", "$tgt.top() == $0"})
    */
   void push(Object o);

   /**
    * @@org.jboss.aspects.dbc.PreCond ({"!$tgt.isEmpty()"})
    */
   Object pop();

   /**
    * @@org.jboss.aspects.dbc.PreCond ({"!$tgt.isEmpty()"})
    */
   Object top();

   boolean isEmpty();
}

