1 Clazz.load(["java.util.Vector"],"java.util.Stack",["java.util.EmptyStackException"],function(){
2 c$=Clazz.declareType(java.util,"Stack",java.util.Vector);
3 Clazz.defineMethod(c$,"empty",
5 return this.elementCount==0;
7 Clazz.defineMethod(c$,"peek",
10 return this.elementData[this.elementCount-1];
12 if(Clazz.instanceOf(e,IndexOutOfBoundsException)){
13 throw new java.util.EmptyStackException();
19 Clazz.defineMethod(c$,"pop",
22 var index=this.elementCount-1;
23 var obj=this.elementData[index];
24 this.removeElementAt(index);
27 if(Clazz.instanceOf(e,IndexOutOfBoundsException)){
28 throw new java.util.EmptyStackException();
34 Clazz.defineMethod(c$,"push",
36 this.addElement(object);
39 Clazz.defineMethod(c$,"search",
41 var index=this.lastIndexOf(o);
42 if(index>=0)return(this.elementCount-index);