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