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