X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fjava%2Futil%2FAbstractSequentialList.js;h=2e5c12f968c619707df1b339a63be207d487437a;hp=04e2d1fcdfae2d4a238ac6b7725272a548f6f717;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/java/util/AbstractSequentialList.js b/site/j2s/java/util/AbstractSequentialList.js index 04e2d1f..2e5c12f 100644 --- a/site/j2s/java/util/AbstractSequentialList.js +++ b/site/j2s/java/util/AbstractSequentialList.js @@ -1,56 +1,56 @@ -Clazz.load(["java.util.AbstractList"],"java.util.AbstractSequentialList",["java.lang.IndexOutOfBoundsException"],function(){ -c$=Clazz.declareType(java.util,"AbstractSequentialList",java.util.AbstractList); -Clazz.defineMethod(c$,"add", -function(location,object){ -this.listIterator(location).add(object); -},"~N,~O"); -Clazz.defineMethod(c$,"addAll", -function(location,collection){ -var it=this.listIterator(location); -var colIt=collection.iterator(); -var next=it.nextIndex(); -while(colIt.hasNext()){ -it.add(colIt.next()); -it.previous(); -} -return next!=it.nextIndex(); -},"~N,java.util.Collection"); -Clazz.overrideMethod(c$,"get", -function(location){ -try{ -return this.listIterator(location).next(); -}catch(e){ -if(Clazz.instanceOf(e,java.util.NoSuchElementException)){ -throw new IndexOutOfBoundsException(); -}else{ -throw e; -} -} -},"~N"); -Clazz.overrideMethod(c$,"iterator", -function(){ -return this.listIterator(0); -}); -Clazz.defineMethod(c$,"remove", -function(location){ -try{ -var it=this.listIterator(location); -var result=it.next(); -it.remove(); -return result; -}catch(e){ -if(Clazz.instanceOf(e,java.util.NoSuchElementException)){ -throw new IndexOutOfBoundsException(); -}else{ -throw e; -} -} -},"~N"); -Clazz.overrideMethod(c$,"set", -function(location,object){ -var it=this.listIterator(location); -var result=it.next(); -it.set(object); -return result; -},"~N,~O"); -}); +Clazz.load(["java.util.AbstractList"],"java.util.AbstractSequentialList",["java.lang.IndexOutOfBoundsException"],function(){ +c$=Clazz.declareType(java.util,"AbstractSequentialList",java.util.AbstractList); +Clazz.defineMethod(c$,"add", +function(location,object){ +this.listIterator(location).add(object); +},"~N,~O"); +Clazz.defineMethod(c$,"addAll", +function(location,collection){ +var it=this.listIterator(location); +var colIt=collection.iterator(); +var next=it.nextIndex(); +while(colIt.hasNext()){ +it.add(colIt.next()); +it.previous(); +} +return next!=it.nextIndex(); +},"~N,java.util.Collection"); +Clazz.overrideMethod(c$,"get", +function(location){ +try{ +return this.listIterator(location).next(); +}catch(e){ +if(Clazz.instanceOf(e,java.util.NoSuchElementException)){ +throw new IndexOutOfBoundsException(); +}else{ +throw e; +} +} +},"~N"); +Clazz.overrideMethod(c$,"iterator", +function(){ +return this.listIterator(0); +}); +Clazz.defineMethod(c$,"remove", +function(location){ +try{ +var it=this.listIterator(location); +var result=it.next(); +it.remove(); +return result; +}catch(e){ +if(Clazz.instanceOf(e,java.util.NoSuchElementException)){ +throw new IndexOutOfBoundsException(); +}else{ +throw e; +} +} +},"~N"); +Clazz.overrideMethod(c$,"set", +function(location,object){ +var it=this.listIterator(location); +var result=it.next(); +it.set(object); +return result; +},"~N,~O"); +});