Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / util / AbstractQueue.js
1 Clazz.load(["java.util.AbstractCollection","$.Queue"],"java.util.AbstractQueue",["java.lang.IllegalArgumentException","$.IllegalStateException","$.NullPointerException","java.util.NoSuchElementException"],function(){
2 c$=Clazz.declareType(java.util,"AbstractQueue",java.util.AbstractCollection,java.util.Queue);
3 Clazz.overrideMethod(c$,"add",
4 function(o){
5 if(null==o){
6 throw new NullPointerException();
7 }if(this.offer(o)){
8 return true;
9 }throw new IllegalStateException();
10 },"~O");
11 Clazz.overrideMethod(c$,"addAll",
12 function(c){
13 if(null==c){
14 throw new NullPointerException();
15 }if(this===c){
16 throw new IllegalArgumentException();
17 }return Clazz.superCall(this,java.util.AbstractQueue,"addAll",[c]);
18 },"java.util.Collection");
19 Clazz.defineMethod(c$,"remove",
20 function(){
21 var o=this.poll();
22 if(null==o){
23 throw new java.util.NoSuchElementException();
24 }return o;
25 });
26 Clazz.overrideMethod(c$,"element",
27 function(){
28 var o=this.peek();
29 if(null==o){
30 throw new java.util.NoSuchElementException();
31 }return o;
32 });
33 Clazz.overrideMethod(c$,"clear",
34 function(){
35 var o;
36 do{
37 o=this.poll();
38 }while(null!=o);
39 });
40 });