File size: 1,547 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 58 59 60 61 | Clazz.load(["java.util.Map"],"java.util.MapEntry",null,function(){
c$=Clazz.decorateAsClass(function(){
this.key=null;
this.value=null;
Clazz.instantialize(this,arguments);
},java.util,"MapEntry",null,[java.util.Map.Entry,Cloneable]);
Clazz.makeConstructor(c$,
function(theKey){
this.key=theKey;
},"~O");
Clazz.makeConstructor(c$,
function(theKey,theValue){
this.key=theKey;
this.value=theValue;
},"~O,~O");
Clazz.defineMethod(c$,"clone",
function(){
try{
return Clazz.superCall(this,java.util.MapEntry,"clone",[]);
}catch(e){
if(Clazz.instanceOf(e,CloneNotSupportedException)){
return null;
}else{
throw e;
}
}
});
Clazz.overrideMethod(c$,"equals",
function(object){
if(this===object){
return true;
}if(Clazz.instanceOf(object,java.util.Map.Entry)){
var entry=object;
return(this.key==null?entry.getKey()==null:this.key.equals(entry.getKey()))&&(this.value==null?entry.getValue()==null:this.value.equals(entry.getValue()));
}return false;
},"~O");
Clazz.overrideMethod(c$,"getKey",
function(){
return this.key;
});
Clazz.overrideMethod(c$,"getValue",
function(){
return this.value;
});
Clazz.overrideMethod(c$,"hashCode",
function(){
return(this.key==null?0:this.key.hashCode())^(this.value==null?0:this.value.hashCode());
});
Clazz.overrideMethod(c$,"setValue",
function(object){
var result=this.value;
this.value=object;
return result;
},"~O");
Clazz.overrideMethod(c$,"toString",
function(){
return this.key+"="+this.value;
});
Clazz.declareInterface(java.util.MapEntry,"Type");
});
|