1 22 package test.dbc.stack; 23 24 29 @org.jboss.aspects.dbc.Dbc 30 @org.jboss.aspects.dbc.Invariant ({"!$tgt.isEmpty() implies $tgt.top() != null","$tgt.isEmpty() implies $tgt.elements.size() == 0"}) 31 public interface Stack 32 { 33 @org.jboss.aspects.dbc.PreCond ({"$0 != null"}) 34 @org.jboss.aspects.dbc.PostCond ({"!$tgt.isEmpty()", "$tgt.top() == $0"}) 35 void push(Object o); 36 37 @org.jboss.aspects.dbc.PreCond ({"!$tgt.isEmpty()"}) 38 Object pop(); 39 40 @org.jboss.aspects.dbc.PreCond ({"!$tgt.isEmpty()"}) 41 Object top(); 42 43 boolean isEmpty(); 44 } 45 46 | Popular Tags |