c2779fdeaa28cef81801239e8f83567e8c56919a
[jalviewjs.git] / site / swingjs / j2s / java / util / MapEntry.js
1 Clazz.load(["java.util.Map"],"java.util.MapEntry",null,function(){
2 c$=Clazz.decorateAsClass(function(){
3 this.key=null;
4 this.value=null;
5 Clazz.instantialize(this,arguments);
6 },java.util,"MapEntry",null,[java.util.Map.Entry,Cloneable]);
7 Clazz.makeConstructor(c$,
8 function(theKey){
9 this.key=theKey;
10 },"~O");
11 Clazz.makeConstructor(c$,
12 function(theKey,theValue){
13 this.key=theKey;
14 this.value=theValue;
15 },"~O,~O");
16 Clazz.defineMethod(c$,"clone",
17 function(){
18 try{
19 return Clazz.superCall(this,java.util.MapEntry,"clone",[]);
20 }catch(e){
21 if(Clazz.instanceOf(e,CloneNotSupportedException)){
22 return null;
23 }else{
24 throw e;
25 }
26 }
27 });
28 Clazz.overrideMethod(c$,"equals",
29 function(object){
30 if(this===object){
31 return true;
32 }if(Clazz.instanceOf(object,java.util.Map.Entry)){
33 var entry=object;
34 return(this.key==null?entry.getKey()==null:this.key.equals(entry.getKey()))&&(this.value==null?entry.getValue()==null:this.value.equals(entry.getValue()));
35 }return false;
36 },"~O");
37 Clazz.overrideMethod(c$,"getKey",
38 function(){
39 return this.key;
40 });
41 Clazz.overrideMethod(c$,"getValue",
42 function(){
43 return this.value;
44 });
45 Clazz.overrideMethod(c$,"hashCode",
46 function(){
47 return(this.key==null?0:this.key.hashCode())^(this.value==null?0:this.value.hashCode());
48 });
49 Clazz.overrideMethod(c$,"setValue",
50 function(object){
51 var result=this.value;
52 this.value=object;
53 return result;
54 },"~O");
55 Clazz.overrideMethod(c$,"toString",
56 function(){
57 return this.key+"="+this.value;
58 });
59 Clazz.declareInterface(java.util.MapEntry,"Type");
60 });