File size: 1,410 Bytes
233f6d4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | 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");
});
|