04e2d1fcdfae2d4a238ac6b7725272a548f6f717
[jalviewjs.git] / site / j2s / java / util / AbstractSequentialList.js
1 Clazz.load(["java.util.AbstractList"],"java.util.AbstractSequentialList",["java.lang.IndexOutOfBoundsException"],function(){\r
2 c$=Clazz.declareType(java.util,"AbstractSequentialList",java.util.AbstractList);\r
3 Clazz.defineMethod(c$,"add",\r
4 function(location,object){\r
5 this.listIterator(location).add(object);\r
6 },"~N,~O");\r
7 Clazz.defineMethod(c$,"addAll",\r
8 function(location,collection){\r
9 var it=this.listIterator(location);\r
10 var colIt=collection.iterator();\r
11 var next=it.nextIndex();\r
12 while(colIt.hasNext()){\r
13 it.add(colIt.next());\r
14 it.previous();\r
15 }\r
16 return next!=it.nextIndex();\r
17 },"~N,java.util.Collection");\r
18 Clazz.overrideMethod(c$,"get",\r
19 function(location){\r
20 try{\r
21 return this.listIterator(location).next();\r
22 }catch(e){\r
23 if(Clazz.instanceOf(e,java.util.NoSuchElementException)){\r
24 throw new IndexOutOfBoundsException();\r
25 }else{\r
26 throw e;\r
27 }\r
28 }\r
29 },"~N");\r
30 Clazz.overrideMethod(c$,"iterator",\r
31 function(){\r
32 return this.listIterator(0);\r
33 });\r
34 Clazz.defineMethod(c$,"remove",\r
35 function(location){\r
36 try{\r
37 var it=this.listIterator(location);\r
38 var result=it.next();\r
39 it.remove();\r
40 return result;\r
41 }catch(e){\r
42 if(Clazz.instanceOf(e,java.util.NoSuchElementException)){\r
43 throw new IndexOutOfBoundsException();\r
44 }else{\r
45 throw e;\r
46 }\r
47 }\r
48 },"~N");\r
49 Clazz.overrideMethod(c$,"set",\r
50 function(location,object){\r
51 var it=this.listIterator(location);\r
52 var result=it.next();\r
53 it.set(object);\r
54 return result;\r
55 },"~N,~O");\r
56 });\r