X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fswingjs%2Fjs%2Fcore.js;fp=site%2Fswingjs%2Fjs%2Fcore.js;h=60dbb9ad5263ec6c8024ded89828572e223d3382;hp=94f7466fcfad16ac2e4aff66b65a4e41012226d3;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/swingjs/js/core.js b/site/swingjs/js/core.js index 94f7466..60dbb9a 100644 --- a/site/swingjs/js/core.js +++ b/site/swingjs/js/core.js @@ -1,2970 +1,2970 @@ -(function(Clazz -,Clazz_getClassName -,Clazz_newLongArray -,Clazz_doubleToByte -,Clazz_doubleToInt -,Clazz_doubleToLong -,Clazz_declarePackage -,Clazz_instanceOf -,Clazz_load -,Clazz_instantialize -,Clazz_decorateAsClass -,Clazz_floatToInt -,Clazz_floatToLong -,Clazz_makeConstructor -,Clazz_defineEnumConstant -,Clazz_exceptionOf -,Clazz_newIntArray -,Clazz_defineStatics -,Clazz_newFloatArray -,Clazz_declareType -,Clazz_prepareFields -,Clazz_superConstructor -,Clazz_newByteArray -,Clazz_declareInterface -,Clazz_p0p -,Clazz_pu$h -,Clazz_newShortArray -,Clazz_innerTypeInstance -,Clazz_isClassDefined -,Clazz_prepareCallback -,Clazz_newArray -,Clazz_castNullAs -,Clazz_floatToShort -,Clazz_superCall -,Clazz_decorateAsType -,Clazz_newBooleanArray -,Clazz_newCharArray -,Clazz_implementOf -,Clazz_newDoubleArray -,Clazz_overrideConstructor -,Clazz_clone -,Clazz_doubleToShort -,Clazz_getInheritedLevel -,Clazz_getParamsType -,Clazz_isAF -,Clazz_isAI -,Clazz_isAS -,Clazz_isASS -,Clazz_isAP -,Clazz_isAFloat -,Clazz_isAII -,Clazz_isAFF -,Clazz_isAFFF -,Clazz_tryToSearchAndExecute -,Clazz_getStackTrace -,Clazz_inheritArgs -,Clazz_alert -,Clazz_defineMethod -,Clazz_overrideMethod -,Clazz_declareAnonymous -,Clazz_checkPrivateMethod -,Clazz_cloneFinals -){ -var $t$; -//var c$; -// JSmolJavaExt.js - - -// This library will be wrapped by an additional anonymous function using ANT in -// build_03_tojs.xml. This task will also modify variable names. References -// to Clazz._ will not be changed, but other Clazz_xxx will be changed to -// (local scope) Clazz_xxx, allowing them to be further compressed using -// Google Closure Compiler in that same ANT task. - -// BH 5/31/2015 5:53:04 PM Number.compareTo added -// BH 5/21/2015 5:46:30 PM Number("0xFFFFFFFF") is not -1 -// BH 4/23/2015 9:08:59 AM xx.getComponentType() is nonfunctional. Array.newInstance now defines a wrapper for .getClass().getComponentType() that works -// BH 4/12/2015 1:37:44 PM adding Math.rint = Math.round -// BH 1/16/2015 10:09:38 AM Chrome failure jqGrig due to new String("x").toString() not being a simple string -// BH 8/14/2014 6:49:22 PM Character class efficiencies -// BH 7/24/2014 9:02:18 AM most browsers do not support String.codePointAt() -// BH 7/11/2014 4:17:22 PM fix for Boolean.valueOf("false") not being false -// BH 5/27/2014 6:29:59 AM ensure floats and doubles have decimal point in toString -// BH 4/1/2014 12:23:41 PM Encoding moved to Clazz._Encoding; -// BH 4/1/2014 7:51:46 AM removing java.lang.B00lean -// BH 3/7/2014 9:17:10 AM removing Array.toString; moving that code here from j2sJmol.js -// BH 1/30/2014 9:04:25 AM adding Throwable.getStackTrace() as a STRING -// BH 12/4/2013 9:20:44 PM fix for reassigning Date.prototype.toString() -// BH 12/3/2013 11:43:10 AM bizarre Safari bug in reassigning Boolean (OK, I admit, we shouldn't have done that...) -// BH 12/1/2013 6:50:16 AM evit Number.prototype.toString assignment removed! -// BH 11/30/2013 1:46:31 PM fixing Byte, Short, Long, Integer, Float, Double to reflect proper bounds and error conditions -// BH 11/29/2013 8:58:49 PM removing Boolean.toString(boolean) -// BH 11/4/2013 7:34:26 AM changing "var nativeClazz" to "var nativeClass" to avoid ANT replacement of "nativeClazz_" to "nativeClazz_" -// BH 10/19/2013 1:29:27 PM fixed String.$replace() -// BH 10/18/2013 6:09:23 PM fixed (Double|Float).valueOf(NaN).valueOf(), which should return NaN, not throw an error -// BH 10/12/2013 11:18:44 AM fixed bug in Double(String) and Float(String) that was returning typeof "string" -// BH 10/10/2013 2:40:20 PM added Math.log10 -// BH 7/23/2013 7:24:01 AM fixing Number.shortValue() and Number.byteValue() for negative values -// BH 6/16/2013 1:31:30 PM adding /| in String.replace -- thank you David Koes -// BH 3/13/2013 12:49:23 PM setting Boolean.valueOf() "@" -// BH 3/2/2013 10:46:45 PM removed Double.valueOf(String) -// BH 11/6/2012 8:26:33 PM added instanceof Int32Array in String.instantialize -// BH 10/13/2012 11:38:07 PM corrected Integer.parseInt to allow only +-0123456789; created Integer.parseIntRadix -// BH 11/1/2012 added Short -// BH 9/10/2012 6:27:21 AM added java.net.URL... classes -// BH 1/7/2013 7:40:06 AM added Clazz_dateToString - -;(function(Clazz) { - -// moved here from package.js -// these classes will be created as objects prior to any others -// and are then available immediately - - Clazz._Loader.registerPackages("java", [ "io", "lang", "lang.reflect", "util" ]); - - var sJU = "java.util"; - - //var sJU = "JU"; - //Clazz._Loader.registerPackages (sJU, ["regex", "zip"]); - //var javautil = JU; - - var javautil = java.util; - - Clazz._Loader.ignore([ - "net.sf.j2s.ajax.HttpRequest", - sJU + ".MapEntry.Type", - //"java.net.UnknownServiceException", - "java.lang.Runtime", - "java.security.AccessController", - "java.security.PrivilegedExceptionAction", - "java.io.File", - "java.io.FileInputStream", - "java.io.FileWriter", - "java.io.OutputStreamWriter", -// sJU + ".Calendar", // bypassed in ModelCollection -// "java.text.SimpleDateFormat", // not used -// "java.text.DateFormat", // not used - sJU + ".concurrent.Executors" - ]) - -Math.rint = Math.round; - -Math.log10||(Math.log10=function(a){return Math.log(a)/2.302585092994046}); - -if(Clazz._supportsNativeObject){ - // Number and Array are special -- do not override prototype.toString -- "length - 2" here - for(var i=0;i 0 ? x - 0x10000 : x); -}); - -Clazz_defineMethod(Number,"byteValue", -function(){ -var x = Math.round(this)&0xff; -return (this < 0 && x > 0 ? x - 0x100 : x); -}); - -Clazz_defineMethod(Number,"intValue", -function(){ -return Math.round(this)&0xffffffff; -}); - -Clazz_defineMethod(Number,"longValue", -function(){ -return Math.round(this); -}); - -Clazz_defineMethod(Number,"floatValue", -function(){ -return this.valueOf(); -}); -Clazz_defineMethod(Number,"doubleValue", -function(){ -return parseFloat(this.valueOf()); -}); - -Clazz_overrideMethod(Number,"hashCode", -function(){ -return this.valueOf(); -}); - -java.lang.Integer=Integer=function(){ -Clazz_instantialize(this,arguments); -}; -Clazz_decorateAsType(Integer,"Integer",Number,Comparable,null,true); -Integer.prototype.valueOf=function(){return 0;}; -Integer.toString=Integer.prototype.toString=function(){ -if(arguments.length!=0){ -return""+arguments[0]; -} else if(this===Integer){ -return"class java.lang.Integer"; -} -return""+this.valueOf(); -}; - -/* - -Clazz_makeConstructor(Integer, -function(){ -this.valueOf=function(){ -return 0; -}; -}); -*/ - - -Clazz_overrideConstructor(Integer, function(v){ - v == null && (v = 0); - if (typeof v != "number") - v = Integer.parseIntRadix(v, 10); - this.valueOf=function(){return v;}; -}); //BH -/* -Clazz_makeConstructor(Integer, -function(s){ -var value=Integer.parseInt(s,10); -this.valueOf=function(){ -return value; -}; -},"String"); -*/ -Integer.MIN_VALUE=Integer.prototype.MIN_VALUE=-0x80000000; -Integer.MAX_VALUE=Integer.prototype.MAX_VALUE=0x7fffffff; -Integer.TYPE=Integer.prototype.TYPE=Integer; - - -Clazz_defineMethod(Integer,"bitCount", -function(i) { - i = i - ((i >>> 1) & 0x55555555); - i = (i & 0x33333333) + ((i >>> 2) & 0x33333333); - i = (i + (i >>> 4)) & 0x0f0f0f0f; - i = i + (i >>> 8); - i = i + (i >>> 16); - return i & 0x3f; -},"Number"); -Integer.bitCount=Integer.prototype.bitCount; - -Clazz_defineMethod(Integer,"numberOfLeadingZeros", -function(i) { - if (i == 0) return 32; - var n = 1; - if (i >>> 16 == 0) { n += 16; i <<= 16; } - if (i >>> 24 == 0) { n += 8; i <<= 8; } - if (i >>> 28 == 0) { n += 4; i <<= 4; } - if (i >>> 30 == 0) { n += 2; i <<= 2; } - n -= i >>> 31; - return n; -},"Number"); -Integer.numberOfLeadingZeros=Integer.prototype.numberOfLeadingZeros; - -Clazz_defineMethod(Integer,"numberOfTrailingZeros", -function(i) { - if (i == 0) return 32; - var n = 31; - var y = i <<16; if (y != 0) { n = n -16; i = y; } - y = i << 8; if (y != 0) { n = n - 8; i = y; } - y = i << 4; if (y != 0) { n = n - 4; i = y; } - y = i << 2; if (y != 0) { n = n - 2; i = y; } - return n - ((i << 1) >>> 31); -},"Number"); -Integer.numberOfTrailingZeros=Integer.prototype.numberOfTrailingZeros; - -Clazz_defineMethod(Integer,"parseIntRadix", -function(s,radix){ -if(s==null){ -throw new NumberFormatException("null"); -}if(radix<2){ -throw new NumberFormatException("radix "+radix+" less than Character.MIN_RADIX"); -}if(radix>36){ -throw new NumberFormatException("radix "+radix+" greater than Character.MAX_RADIX"); -} -if (radix == 10) { - for (var i = s.length; --i >= 0;) { - var c = s.charCodeAt(i); - if (c >= 48 && c <= 57) continue; - if (i > 0 || c != 43 && c != 45) - throw new NumberFormatException("Not a Number : "+s); - - } -} -var i=parseInt(s,radix); -if(isNaN(i)){ -throw new NumberFormatException("Not a Number : "+s); -} -return i; -},"String, Number"); -Integer.parseIntRadix=Integer.prototype.parseIntRadix; - -Clazz_defineMethod(Integer,"parseInt", -function(s){ -return Integer.parseIntRadix(s,10); -},"String"); -Integer.parseInt=Integer.prototype.parseInt; - -/* -Clazz_defineMethod(Integer,"$valueOf", -function(s){ -return new Integer(Integer.parseIntRadix(s,10)); -},"String"); -*/ - -Clazz_overrideMethod(Integer,"$valueOf", -function(s){ -return new Integer(s); -}); - -/* -Clazz_defineMethod(Integer,"$valueOf", -function(s,r){ -return new Integer(Integer.parseIntRadix(s,r)); -},"String, Number"); -*/ - -Integer.$valueOf=Integer.prototype.$valueOf; - - -Clazz_overrideMethod(Integer,"equals", -function(s){ -if(s==null||!Clazz_instanceOf(s,Integer)){ -return false; -} -return s.valueOf()==this.valueOf(); -},"Object"); -Integer.toHexString=Integer.prototype.toHexString=function(d){ -if(d.valueOf)d=d.valueOf(); -if (d < 0) { -var b = d & 0xFFFFFF; -var c = ((d>>24)&0xFF); -return c._numberToString(16) + (b = "000000" + b._numberToString(16)).substring(b.length - 6); -} -return d._numberToString(16);}; -Integer.toOctalString=Integer.prototype.toOctalString=function(d){if(d.valueOf)d=d.valueOf();return d._numberToString(8);}; -Integer.toBinaryString=Integer.prototype.toBinaryString=function(d){if(d.valueOf)d=d.valueOf();return d._numberToString(2);}; - -Integer.decodeRaw=Clazz_defineMethod(Integer,"decodeRaw", function(n){ -if (n.indexOf(".") >= 0)n = ""; -var i = (n.startsWith("-") ? 1 : 0); -n = n.replace(/\#/, "0x").toLowerCase(); -var radix=(n.startsWith("0x", i) ? 16 : n.startsWith("0", i) ? 8 : 10); -// The general problem with parseInt is that is not strict -- ParseInt("10whatever") == 10. -// Number is strict, but Number("055") does not work, though ParseInt("055", 8) does. -// need to make sure negative numbers are negative -n = Number(n) & 0xFFFFFFFF; -return (radix == 8 ? parseInt(n, 8) : n); -},"~S"); - -Integer.decode=Clazz_defineMethod(Integer,"decode", function(n){ - n = Integer.decodeRaw(n); - if (isNaN(n) || n < Integer.MIN_VALUE|| n > Integer.MAX_VALUE) - throw new NumberFormatException("Invalid Integer"); - return new Integer(n); -},"~S"); - -Clazz_overrideMethod(Integer,"hashCode", -function(){ -return this.valueOf(); -}); - -// Note that Long is problematic in JavaScript - -java.lang.Long=Long=function(){ -Clazz_instantialize(this,arguments); -}; -Clazz_decorateAsType(Long,"Long",Number,Comparable,null,true); -Long.prototype.valueOf=function(){return 0;}; -Long.toString=Long.prototype.toString=function(){ -if(arguments.length!=0){ -return""+arguments[0]; -}else if(this===Long){ -return"class java.lang.Long"; -} -return""+this.valueOf(); -}; - -Clazz_overrideConstructor(Long, function(v){ - v == null && (v = 0); - v = (typeof v == "number" ? Math.round(v) : Integer.parseIntRadix(v, 10)); -this.valueOf=function(){return v;}; -}); - -//Long.MIN_VALUE=Long.prototype.MIN_VALUE=-0x8000000000000000; -//Long.MAX_VALUE=Long.prototype.MAX_VALUE=0x7fffffffffffffff; -Long.TYPE=Long.prototype.TYPE=Long; - -Clazz_defineMethod(Long,"parseLong", -function(s,radix){ - return Integer.parseInt(s, radix || 10); -}); - -Long.parseLong=Long.prototype.parseLong; - -Clazz_overrideMethod(Long,"$valueOf", -function(s){ -return new Long(s); -}); -/* -Clazz_defineMethod(Long,"$valueOf", -function(s){ -return new Long(s); -},"Number"); - -Clazz_defineMethod(Long,"$valueOf", -function(s,r){ -return new Long(Long.parseLong(s,r)); -},"String, Number"); -*/ -Long.$valueOf=Long.prototype.$valueOf; -Clazz_overrideMethod(Long,"equals", -function(s){ -if(s==null||!Clazz_instanceOf(s,Long)){ -return false; -} -return s.valueOf()==this.valueOf(); -},"Object"); -Long.toHexString=Long.prototype.toHexString=function(i){ -return i.toString(16); -}; -Long.toOctalString=Long.prototype.toOctalString=function(i){ -return i.toString(8); -}; -Long.toBinaryString=Long.prototype.toBinaryString=function(i){ -return i.toString(2); -}; - - -Long.decode=Clazz_defineMethod(Long,"decode", -function(n){ - n = Integer.decodeRaw(n); - if (isNaN(n)) - throw new NumberFormatException("Invalid Long"); - return new Long(n); -},"~S"); - -java.lang.Short = Short = function () { -Clazz_instantialize (this, arguments); -}; -Clazz_decorateAsType (Short, "Short", Number, Comparable, null, true); -Short.prototype.valueOf = function () { return 0; }; -Short.toString = Short.prototype.toString = function () { - if (arguments.length != 0) { - return "" + arguments[0]; - } else if (this === Short) { - return "class java.lang.Short"; // Short.class.toString - } - return "" + this.valueOf (); -}; - -Clazz_overrideConstructor(Short, -function (v) { - v == null && (v = 0); - if (typeof v != "number") - v = Integer.parseIntRadix(v, 10); - v = v.shortValue(); - this.valueOf = function () {return v;}; -}); - - -Short.MIN_VALUE = Short.prototype.MIN_VALUE = -32768; -Short.MAX_VALUE = Short.prototype.MAX_VALUE = 32767; -Short.TYPE = Short.prototype.TYPE = Short; - -Clazz_defineMethod(Short, "parseShortRadix", -function (s, radix) { -return Integer.parseIntRadix(s, radix).shortValue(); -}, "String, Number"); -Short.parseShortRadix = Short.prototype.parseShortRadix; - -Clazz_defineMethod(Short, "parseShort", -function (s) { -return Short.parseShortRadix (s, 10); -}, "String"); - -Short.parseShort = Short.prototype.parseShort; - -/* -Clazz_defineMethod(Short, "$valueOf", -function (s) { -return new Short(Short.parseShort (s, 10)); -}, "String"); - */ - -Clazz_overrideMethod(Short, "$valueOf", -function (s) { -return new Short(s); -}); - -/* -Clazz_defineMethod(Short, "$valueOf", -function (s, r) { -return new Short(Short.parseShort (s, r)); -}, "String, Number"); - */ - -Short.$valueOf = Short.prototype.$valueOf; -Clazz_overrideMethod(Short, "equals", -function (s) { -if(s == null || !Clazz_instanceOf(s, Short) ){ - return false; -} -return s.valueOf() == this.valueOf(); -}, "Object"); -Short.toHexString = Short.prototype.toHexString = function (i) { - return i.toString (16); -}; -Short.toOctalString = Short.prototype.toOctalString = function (i) { - return i.toString (8); -}; -Short.toBinaryString = Short.prototype.toBinaryString = function (i) { - return i.toString (2); -}; -Short.decode = Clazz_defineMethod(Short, "decode", -function(n){ - n = Integer.decodeRaw(n); - if (isNaN(n) || n < -32768|| n > 32767) - throw new NumberFormatException("Invalid Short"); - return new Short(n); -}, "~S"); - -java.lang.Byte=Byte=function(){ -Clazz_instantialize(this,arguments); -}; -Clazz_decorateAsType(Byte,"Byte",Number,Comparable,null,true); -Byte.prototype.valueOf=function(){return 0;}; -Byte.toString=Byte.prototype.toString=function(){ -if(arguments.length!=0){ -return""+arguments[0]; -}else if(this===Byte){ -return"class java.lang.Byte"; -} -return""+this.valueOf(); -}; -Clazz_makeConstructor(Byte, -function(v){ - if (typeof v != "number") - v = Integer.parseIntRadix(v, 10); - v = v.byteValue(); -this.valueOf=function(){ -return v; -}; -}); - -Byte.serialVersionUID=Byte.prototype.serialVersionUID=-7183698231559129828; -Byte.MIN_VALUE=Byte.prototype.MIN_VALUE=-128; -Byte.MAX_VALUE=Byte.prototype.MAX_VALUE=127; -Byte.SIZE=Byte.prototype.SIZE=8; -Byte.TYPE=Byte.prototype.TYPE=Byte; - -Clazz_defineMethod(Byte,"parseByteRadix", -function(s,radix){ - return Integer.parseIntRadix(s, radix).byteValue(); -},"String, Number"); -Byte.parseByteRadix=Byte.prototype.parseByteRadix; - -Clazz_defineMethod(Byte,"parseByte", -function(s){ -return Byte.parseByte(s,10); -},"String"); - -Byte.parseByte=Byte.prototype.parseByte; - -Clazz_overrideMethod(Byte, "$valueOf", -function (s) { -return new Byte(s); -}); - -Byte.$valueOf=Byte.prototype.$valueOf; -Clazz_overrideMethod(Byte,"equals", -function(s){ -if(s==null||!Clazz_instanceOf(s,Byte)){ -return false; -} -return s.valueOf()==this.valueOf(); -},"Object"); -Byte.toHexString=Byte.prototype.toHexString=function(i){ -return i.toString(16); -}; -Byte.toOctalString=Byte.prototype.toOctalString=function(i){ -return i.toString(8); -}; -Byte.toBinaryString=Byte.prototype.toBinaryString=function(i){ -return i.toString(2); -}; -Byte.decode=Clazz_defineMethod(Byte,"decode", -function(n){ - n = Integer.decodeRaw(n); - if (isNaN(n) || n < -128|| n > 127) - throw new NumberFormatException("Invalid Byte"); -return new Byte(n); -},"~S"); - -Clazz._floatToString = function(f) { - var s = ""+f - if (s.indexOf(".") < 0 && s.indexOf("e") < 0) - s += ".0"; - return s; -} - -java.lang.Float=Float=function(){ -Clazz_instantialize(this,arguments); -}; -Clazz_decorateAsType(Float,"Float",Number,Comparable,null,true); -Float.prototype.valueOf=function(){return 0;}; -Float.toString=Float.prototype.toString=function(){ -if(arguments.length!=0){ -return Clazz._floatToString(arguments[0]); -}else if(this===Float){ -return"class java.lang.Float"; -} -return Clazz._floatToString(this.valueOf()); -}; - -Clazz_overrideConstructor(Float, function(v){ - v == null && (v = 0); - if (typeof v != "number") - v = Number(v); - this.valueOf=function(){return v;} -}); - -Float.serialVersionUID=Float.prototype.serialVersionUID=-2671257302660747028; -Float.MIN_VALUE=Float.prototype.MIN_VALUE=3.4028235e+38; -Float.MAX_VALUE=Float.prototype.MAX_VALUE=1.4e-45; -Float.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY; -Float.POSITIVE_INFINITY=Number.POSITIVE_INFINITY; -Float.NaN=Number.NaN; -Float.TYPE=Float.prototype.TYPE=Float; - -Clazz_defineMethod(Float,"parseFloat", -function(s){ -if(s==null){ -throw new NumberFormatException("null"); -} -if (typeof s == "number")return s; // important -- typeof NaN is "number" and is OK here -var floatVal=Number(s); -if(isNaN(floatVal)){ -throw new NumberFormatException("Not a Number : "+s); -} -return floatVal; -},"String"); -Float.parseFloat=Float.prototype.parseFloat; - -Clazz_overrideMethod(Float,"$valueOf", -function(s){ -return new Float(s); -}); - -Float.$valueOf=Float.prototype.$valueOf; - -Clazz_defineMethod(Float,"isNaN", -function(num){ -return isNaN(num); -},"Number"); -Float.isNaN=Float.prototype.isNaN; -Clazz_defineMethod(Float,"isInfinite", -function(num){ -return!isFinite(num); -},"Number"); -Float.isInfinite=Float.prototype.isInfinite; - -Clazz_overrideMethod(Float,"equals", -function(s){ -if(s==null||!Clazz_instanceOf(s,Float)){ -return false; -} -return s.valueOf()==this.valueOf(); -},"Object"); - -java.lang.Double=Double=function(){ -Clazz_instantialize(this,arguments); -}; -Clazz_decorateAsType(Double,"Double",Number,Comparable,null,true); -Double.prototype.valueOf=function(){return 0;}; -Double.toString=Double.prototype.toString=function(){ -if(arguments.length!=0){ -return Clazz._floatToString(arguments[0]); -}else if(this===Double){ -return"class java.lang.Double"; -} -return Clazz._floatToString(this.valueOf()); -}; - -Clazz_overrideConstructor(Double, function(v){ - v == null && (v = 0); - if (typeof v != "number") - v = Double.parseDouble(v); - this.valueOf=function(){return v;}; -}); // BH - -Double.serialVersionUID=Double.prototype.serialVersionUID=-9172774392245257468; -Double.MIN_VALUE=Double.prototype.MIN_VALUE=4.9e-324; -Double.MAX_VALUE=Double.prototype.MAX_VALUE=1.7976931348623157e+308; -Double.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY; -Double.POSITIVE_INFINITY=Number.POSITIVE_INFINITY; -Double.NaN=Number.NaN; -Double.TYPE=Double.prototype.TYPE=Double; - -Clazz_defineMethod(Double,"isNaN", -function(num){ -return isNaN(num); -},"Number"); -Double.isNaN=Double.prototype.isNaN; -Clazz_defineMethod(Double,"isInfinite", -function(num){ -return!isFinite(num); -},"Number"); -Double.isInfinite=Double.prototype.isInfinite; - -Clazz_defineMethod(Double,"parseDouble", -function(s){ -if(s==null){ -throw new NumberFormatException("null"); -} -if (typeof s == "number")return s; // important -- typeof NaN is "number" and is OK here -var doubleVal=Number(s); -if(isNaN(doubleVal)){ -throw new NumberFormatException("Not a Number : "+s); -} -return doubleVal; -},"String"); -Double.parseDouble=Double.prototype.parseDouble; - -/* -Clazz_defineMethod(Double,"$valueOf", -function(s){ -return new Double(this.parseDouble(s)); -},"String"); -*/ - -Clazz_defineMethod(Double,"$valueOf", -function(v){ -return new Double(v); -},"Number"); - -Double.$valueOf=Double.prototype.$valueOf; - -Clazz_overrideMethod(Double,"equals", -function(s){ -if(s==null||!Clazz_instanceOf(s,Double)){ -return false; -} -return s.valueOf()==this.valueOf(); -},"Object"); - - -//java.lang.B00lean = Boolean; ?? BH why this? -Boolean = java.lang.Boolean = Boolean || function () {Clazz_instantialize (this, arguments);}; -if (Clazz._supportsNativeObject) { - for (var i = 0; i < Clazz._extendedObjectMethods.length; i++) { - var p = Clazz._extendedObjectMethods[i]; - Boolean.prototype[p] = Clazz._O.prototype[p]; - } -} -Boolean.__CLASS_NAME__="Boolean"; -Clazz_implementOf(Boolean,[java.io.Serializable,java.lang.Comparable]); -Boolean.equals=Clazz._innerFunctions.equals; -Boolean.getName=Clazz._innerFunctions.getName; -Boolean.serialVersionUID=Boolean.prototype.serialVersionUID=-3665804199014368530; - -//Clazz_makeConstructor(Boolean, -//function(value){ -//this.valueOf=function(){ -//return value; -//}; -//},"~B"); - -Clazz_overrideConstructor(Boolean, -function(s){ - var b = ((typeof s == "string" ? Boolean.toBoolean(s) : s) ? true : false); - this.valueOf=function(){return b;}; -},"~O"); - -Boolean.parseBoolean=Clazz_defineMethod(Boolean,"parseBoolean", -function(s){ -return Boolean.toBoolean(s); -},"~S"); -Clazz_defineMethod(Boolean,"booleanValue", -function(){ -return this.valueOf(); -}); -Boolean.$valueOf=Clazz_overrideMethod(Boolean,"$valueOf", -function(b){ -return((typeof b == "string"? "true".equalsIgnoreCase(b) : b)?Boolean.TRUE:Boolean.FALSE); -}); - -/* -Boolean.toString=Clazz_defineMethod(Boolean,"toString", -function(b){ -return b?"true":"false"; -},"~B"); -*/ - -Clazz_overrideMethod(Boolean,"toString", -function(){ -return this.valueOf()?"true":"false"; -}); -Clazz_overrideMethod(Boolean,"hashCode", -function(){ -return this.valueOf()?1231:1237; -}); -Clazz_overrideMethod(Boolean,"equals", -function(obj){ -if(Clazz_instanceOf(obj,Boolean)){ -return this.booleanValue()==obj.booleanValue(); -}return false; -},"~O"); -Boolean.getBoolean=Clazz_defineMethod(Boolean,"getBoolean", -function(name){ -var result=false; -try{ -result=Boolean.toBoolean(System.getProperty(name)); -}catch(e){ -if(Clazz_instanceOf(e,IllegalArgumentException)){ -}else if(Clazz_instanceOf(e,NullPointerException)){ -}else{ -throw e; -} -} -return result; -},"~S"); -Clazz_overrideMethod(Boolean,"compareTo", -function(b){ -return(b.value==this.value?0:(this.value?1:-1)); -},"Boolean"); -Boolean.toBoolean=Clazz_defineMethod(Boolean,"toBoolean", -($fz=function(name){ -return((name!=null)&&name.equalsIgnoreCase("true")); -},$fz.isPrivate=true,$fz),"~S"); -Boolean.TRUE=Boolean.prototype.TRUE=new Boolean(true); -Boolean.FALSE=Boolean.prototype.FALSE=new Boolean(false); -Boolean.TYPE=Boolean.prototype.TYPE=Boolean; - - -Clazz._Encoding=new Object(); - -(function(Encoding) { - -Encoding.UTF8="utf-8"; -Encoding.UTF16="utf-16"; -Encoding.ASCII="ascii"; - - -Encoding.guessEncoding=function(str){ -if(str.charCodeAt(0)==0xEF&&str.charCodeAt(1)==0xBB&&str.charCodeAt(2)==0xBF){ -return Encoding.UTF8; -}else if(str.charCodeAt(0)==0xFF&&str.charCodeAt(1)==0xFE){ -return Encoding.UTF16; -}else{ -return Encoding.ASCII; -} -}; - -Encoding.readUTF8=function(str){ -var encoding=this.guessEncoding(str); -var startIdx=0; -if(encoding==Encoding.UTF8){ -startIdx=3; -}else if(encoding==Encoding.UTF16){ -startIdx=2; -} -var arrs=new Array(); -for(var i=startIdx;i0xc0&&charCode<0xe0){ -var c1=charCode&0x1f; -i++; -var c2=str.charCodeAt(i)&0x3f; -var c=(c1<<6)+c2; -arrs[arrs.length]=String.fromCharCode(c); -}else if(charCode>=0xe0){ -var c1=charCode&0x0f; -i++; -var c2=str.charCodeAt(i)&0x3f; -i++; -var c3=str.charCodeAt(i)&0x3f; -var c=(c1<<12)+(c2<<6)+c3; -arrs[arrs.length]=String.fromCharCode(c); -} -} -return arrs.join(''); -}; - -Encoding.convert2UTF8=function(str){ -var encoding=this.guessEncoding(str); -var startIdx=0; -if(encoding==Encoding.UTF8){ -return str; -}else if(encoding==Encoding.UTF16){ -startIdx=2; -} - -var offset=0; -var arrs=new Array(offset+str.length-startIdx); - -for(var i=startIdx;i>6); -var c2=0x80+(charCode&0x003f); -arrs[offset+i-startIdx]=String.fromCharCode(c1)+String.fromCharCode(c2); -}else{ -var c1=0xe0+((charCode&0xf000)>>12); -var c2=0x80+((charCode&0x0fc0)>>6); -var c3=0x80+(charCode&0x003f); -arrs[offset+i-startIdx]=String.fromCharCode(c1)+String.fromCharCode(c2)+String.fromCharCode(c3); -} -} -return arrs.join(''); -}; -Encoding.base64Chars=new Array( -'A','B','C','D','E','F','G','H', -'I','J','K','L','M','N','O','P', -'Q','R','S','T','U','V','W','X', -'Y','Z','a','b','c','d','e','f', -'g','h','i','j','k','l','m','n', -'o','p','q','r','s','t','u','v', -'w','x','y','z','0','1','2','3', -'4','5','6','7','8','9','+','/' -); -Encoding.encodeBase64=function(str){ -if(str==null||str.length==0)return str; -var b64=Encoding.base64Chars; -var length=str.length; -var index=0; -var buf=[]; -var c0,c1,c2; -while(index>2]; -if(index>4)]; -if(index>6)]; -buf[buf.length]=b64[c2&0x3F]; -}else{ -buf[buf.length]=b64[((c1<<2)&0x3c)]; -buf[buf.length]='='; -} -}else{ -buf[buf.length]=b64[(c0<<4)&0x30]; -buf[buf.length]='='; -buf[buf.length]='='; -} -} -return buf.join(''); -}; -Encoding.decodeBase64=function(str){ -if(str==null||str.length==0)return str; -var b64=Encoding.base64Chars; -var xb64=Encoding.xBase64Chars; -if(Encoding.xBase64Chars==null){ -xb64=new Object(); -for(var i=0;i>4); -if(c2!=null){ -buf[buf.length]=String.fromCharCode(((c1<<4)&0xff)|c2>>2); -if(c3!=null){ -buf[buf.length]=String.fromCharCode(((c2<<6)&0xff)|c3); -} -} -} -return buf.join(''); -}; - -if(String.prototype.$replace==null){ -java.lang.String=String; -if(Clazz._supportsNativeObject){ -for(var i=0;i= 0) c1 = "\\" + c1; - } else { - c1=c1.replace(/([\\\$\.\*\+\|\?\^\{\}\(\)\[\]])/g,function($0,$1){return"\\"+$1;}); - } - return this.replace(new RegExp(c1,"gm"),c2); -}; -sp.$generateExpFunction=function(str){ -var arr=[]; -var orders=[]; -var idx=0; -arr[0]=""; -var i=0; -for(;ithis.length-len)|| -(ooffset>other.length-len)){ -return false; -} -var s1=this.substring(toffset,toffset+len); -var s2=other.substring(ooffset,ooffset+len); -if(ignoreCase){ -s1=s1.toLowerCase(); -s2=s2.toLowerCase(); -} -return s1==s2; -}; - - - -sp.$plit=function(regex,limit){ -if (!limit && regex == " ") - return this.split(regex); - -if(limit!=null&&limit>0){ -if(limit==1){ -return this; -} -var regExp=new RegExp("("+regex+")","gm"); -var count=1; -var s=this.replace(regExp,function($0,$1){ -count++; -if(count==limit){ -return"@@_@@"; -}else if(count>limit){ -return $0; -}else{ -return $0; -} -}); -regExp=new RegExp(regex,"gm"); -var arr=this.split(regExp); -if(arr.length>limit){ -arr[limit-1]=s.substring(s.indexOf("@@_@@")+5); -arr.length=limit; -} -return arr; -}else{ -var regExp=new RegExp(regex,"gm"); -return this.split(regExp); -} -}; -/* -sp.trim=function(){ -var len=this.length; -var st=0; - -while((st0)||(lens.length-pc)){ -return false; -} -while(--pc>=0){ -if(s.charAt(to++)!=prefix.charAt(po++)){ -return false; -} -} -return true; -}; - -sp.startsWith=function(prefix){ -if(arguments.length==1){ -return sn(this,arguments[0],0); -}else if(arguments.length==2){ -return sn(this,arguments[0],arguments[1]); -}else{ -return false; -} -}; - -sp.endsWith=function(suffix){ -return sn(this, suffix,this.length-suffix.length); -}; - -} - -sp.equals=function(anObject){ -return this.valueOf()==anObject; -}; - -sp.equalsIgnoreCase=function(anotherString){ -return(anotherString==null)?false:(this==anotherString -||this.toLowerCase()==anotherString.toLowerCase()); -}; - - -sp.hash=0; - -sp.hashCode=function(){ -var h=this.hash; -if(h==0){ -var off=0; -var len=this.length; -for(var i=0;i255){ -arrs[ii]=0x1a; -arrs[ii+1]=c&0xff; -arrs[ii+2]=(c&0xff00)>>8; -ii+=2; -}else{ -arrs[ii]=c; -} -ii++; -} -return arrs; -}; - -/* -sp.compareTo=function(anotherString){ -if(anotherString==null){ -throw new java.lang.NullPointerException(); -} -var len1=this.length; -var len2=anotherString.length; -var n=Math.min(len1,len2); -var k=0; -while(k= 0} // bh added -sp.compareTo = function(a){return this > a ? 1 : this < a ? -1 : 0} // bh added - - - -sp.toCharArray=function(){ -var result=new Array(this.length); -for(var i=0;is2){ -return 1; -}else{ -return-1; -} -} -}; - -sp.contentEquals=function(sb){ -if(this.length!=sb.length()){ -return false; -} -var v=sb.getValue(); -var i=0; -var j=0; -var n=this.length; -while(n--!=0){ -if(this.charCodeAt(i++)!=v[j++]){ -return false; -} -} -return true; -}; - -sp.getChars=function(srcBegin,srcEnd,dst,dstBegin){ -if(srcBegin<0){ -throw new StringIndexOutOfBoundsException(srcBegin); -} -if(srcEnd>this.length){ -throw new StringIndexOutOfBoundsException(srcEnd); -} -if(srcBegin>srcEnd){ -throw new StringIndexOutOfBoundsException(srcEnd-srcBegin); -} -if(dst==null){ -throw new NullPointerException(); -} -for(var i=0;i=sourceCount){ -return(targetCount==0?sourceCount:-1); -} -if(fromIndex<0){ -fromIndex=0; -} -if(targetCount==0){ -return fromIndex; -} - -var first=target[targetOffset]; -var i=sourceOffset+fromIndex; -var max=sourceOffset+(sourceCount-targetCount); - -startSearchForFirstChar: -while(true){ - -while(i<=max&&source[i]!=first){ -i++; -} -if(i>max){ -return-1; -} - - -var j=i+1; -var end=j+targetCount-1; -var k=targetOffset+1; -while(j0&&typeof x[0]=="number"){ -var arr=new Array(x.length); -for(var i=0;ibytes.length){ -throw new IndexOutOfBoundsException(); -} -if(length>0){ -var isChar=(bytes[offset].length!=null); -if(isChar){ -for(var i=0;i0;){ -value[i]=String.fromCharCode(bytes[i+offset]&0xff); -} -}else{ -hibyte<<=8; -for(var i=count;i-->0;){ -value[i]=String.fromCharCode(hibyte|(bytes[i+offset]&0xff)); -} -} -return value.join(''); -} -}else{ -var s=""; -for(var i=0;ibytes.length){ - throw new IndexOutOfBoundsException(); - } - if(length>0){ - var isChar=(bytes[offset].length!=null); - if(isChar){ - for(var i=0;i0;){ - value[i]=String.fromCharCode(bytes[i+offset]&0xff); - } - }else{ - hibyte<<=8; - for(var i=count;i-->0;){ - value[i]=String.fromCharCode(hibyte|(bytes[i+offset]&0xff)); - } - } - return value.join(''); -default: - var s=""; - for(var i=0;i= 0x1c && c <= 0x20 || c >= 0x9 && c <= 0xd || c == 0x1680 - || c >= 0x2000 && c != 0x2007 && (c <= 0x200b || c == 0x2028 || c == 0x2029 || c == 0x3000)); -},"~N"); -c$.isLetter=Clazz_defineMethod(c$,"isLetter", -function(c){ -c = c.charCodeAt(0); -return (65 <= c && c <= 90 || 97 <= c && c <= 122); -},"~N"); -c$.isLetterOrDigit=Clazz_defineMethod(c$,"isLetterOrDigit", -function(c){ -c = c.charCodeAt(0); -return (65 <= c && c <= 90 || 97 <= c && c <= 122 || 48 <= c && c <= 57); -},"~N"); -c$.isSpaceChar=Clazz_defineMethod(c$,"isSpaceChar", -function(c){ - var i = c.charCodeAt(0); -if(i==0x20||i==0xa0||i==0x1680)return true; -if(i<0x2000)return false; -return i<=0x200b||i==0x2028||i==0x2029||i==0x202f||i==0x3000; -},"~N"); -c$.digit=Clazz_defineMethod(c$,"digit", -function(c,radix){ -var i = c.charCodeAt(0); -if(radix >= 2 && radix <= 36){ - if(i < 128){ - var result = -1; - if(48 <= i && i <= 57){ - result = i - 48; - }else if(97 <= i && i <= 122){ - result = i - 87; - }else if(65 <= i && i <= 90){ - result=i-(55); - } - return (result < radix ? result : -1); - } -} -return -1; -},"~N,~N"); -Clazz_overrideMethod(c$,"toString", -function(){ -var buf=[this.value]; -return String.valueOf(buf); -}); -c$.toString=Clazz_overrideMethod(c$,"toString", -function(c){ -{ -if(this===Character){ -return"class java.lang.Character"; -} -}return String.valueOf(c); -},"~N"); -Clazz_defineStatics(c$, -"MIN_VALUE",'\u0000', -"MAX_VALUE",'\uffff', -"MIN_RADIX",2, -"MAX_RADIX",36, -"TYPE",null); - -java.lang.Character.TYPE=java.lang.Character.prototype.TYPE=java.lang.Character; - - - -Clazz._ArrayWrapper = function(a, type) { - return { - a: a, - __CLASS_NAME__:"Array", - superClazz: Array, - getComponentType: function() {return type}, - instanceOf: function(o) { return Clazz_instanceOf(type, o) }, - getName: function() { return this.__CLASS_NAME__ } - }; -} -c$=Clazz_declareType(java.lang.reflect,"Array"); -c$.newInstance=Clazz_defineMethod(c$,"newInstance", -function(componentType,size){ -var a = Clazz_newArray(size); - a.getClass = function() { return new Clazz._ArrayWrapper(this, componentType);}; -return a; -},"Class,~N"); - -javautil.Date=Date; -Date.TYPE="javautil.Date"; -Date.__CLASS_NAME__="Date"; -Clazz_implementOf(Date,[java.io.Serializable,java.lang.Comparable]); - -Clazz_defineMethod(javautil.Date,"clone", -function(){ -return new Date(this.getTime()); -}); - -Clazz_defineMethod(javautil.Date,"before", -function(when){ -return this.getTime()when.getTime(); -},"javautil.Date"); -Clazz_defineMethod(javautil.Date,"equals", -function(obj){ -return Clazz_instanceOf(obj,javautil.Date)&&this.getTime()==(obj).getTime(); -},"Object"); -Clazz_defineMethod(javautil.Date,"compareTo", -function(anotherDate){ -var thisTime=this.getTime(); -var anotherTime=anotherDate.getTime(); -return(thisTime>32)); -}); - -c$=Clazz_decorateAsClass(function(){ -this.source=null; -Clazz_instantialize(this,arguments); -},javautil,"EventObject",null,java.io.Serializable); -Clazz_makeConstructor(c$, -function(source){ -if(source!=null)this.source=source; -else throw new IllegalArgumentException(); -},"~O"); -Clazz_defineMethod(c$,"getSource", -function(){ -return this.source; -}); -Clazz_overrideMethod(c$,"toString", -function(){ -return this.getClass().getName()+"[source="+String.valueOf(this.source)+']'; -}); -Clazz_declareInterface(javautil,"EventListener"); - -c$=Clazz_decorateAsClass(function(){ -this.listener=null; -Clazz_instantialize(this,arguments); -},javautil,"EventListenerProxy",null,javautil.EventListener); -Clazz_makeConstructor(c$, -function(listener){ -this.listener=listener; -},"javautil.EventListener"); -Clazz_defineMethod(c$,"getListener", -function(){ -return this.listener; -}); -Clazz_declareInterface(javautil,"Iterator"); - -Clazz_declareInterface(javautil,"ListIterator",javautil.Iterator); -Clazz_declareInterface(javautil,"Enumeration"); -Clazz_declareInterface(javautil,"Collection",Iterable); - -Clazz_declareInterface(javautil,"Set",javautil.Collection); -Clazz_declareInterface(javautil,"Map"); -Clazz_declareInterface(javautil.Map,"Entry"); - -Clazz_declareInterface(javautil,"List",javautil.Collection); - -Clazz_declareInterface(javautil,"Queue",javautil.Collection); -Clazz_declareInterface(javautil,"RandomAccess"); -c$=Clazz_decorateAsClass(function(){ -this.detailMessage=null; -this.cause=null; -this.stackTrace=null; -Clazz_instantialize(this,arguments); -},java.lang,"Throwable",null,java.io.Serializable); -Clazz_prepareFields(c$,function(){ -this.cause=this; -//alert("e0 "+ arguments.callee.caller.caller.caller.caller.caller) -}); -Clazz_makeConstructor(c$, -function(){ -this.fillInStackTrace(); -}); -Clazz_makeConstructor(c$, -function(message){ -this.fillInStackTrace(); -this.detailMessage=message; -},"~S"); -Clazz_makeConstructor(c$, -function(message,cause){ -this.fillInStackTrace(); -this.detailMessage=message; -this.cause=cause; -},"~S,Throwable"); -Clazz_makeConstructor(c$, -function(cause){ -this.fillInStackTrace(); -this.detailMessage=(cause==null?null:cause.toString()); -this.cause=cause; -},"Throwable"); -Clazz_defineMethod(c$,"getMessage", -function(){ -return (this.message || this.detailMessage || this.toString()); -}); -Clazz_defineMethod(c$,"getLocalizedMessage", -function(){ -return this.getMessage(); -}); -Clazz_defineMethod(c$,"getCause", -function(){ -return(this.cause===this?null:this.cause); -}); -Clazz_defineMethod(c$,"initCause", -function(cause){ -if(this.cause!==this)throw new IllegalStateException("Can't overwrite cause"); -if(cause===this)throw new IllegalArgumentException("Self-causation not permitted"); -this.cause=cause; -return this; -},"Throwable"); -Clazz_overrideMethod(c$,"toString", -function(){ -var s=this.getClass().getName(); -var message=this.message || this.detailMessage; -return(message ? s+": "+message : s); -}); -Clazz_defineMethod(c$,"printStackTrace", -function(){ -System.err.println(this.getStackTrace ? this.getStackTrace() : this.message + " " + Clazz_getStackTrace()); -}); - -Clazz_defineMethod(c$,"getStackTrace", -function(){ -var s = "" + this + "\n"; -for(var i=0;i-1||caller!=null){ -var clazzName=null; -var nativeClass=null; -if(!noLooping||caller==Clazz_tryToSearchAndExecute||caller==Clazz_superCall||caller==null){ -if(index<0){ -break; -} -noLooping=true; -superCaller=Clazz._callingStackTraces[index].caller; -nativeClass=Clazz._callingStackTraces[index].owner; -index--; -}else{ -superCaller=caller; -if(superCaller.claxxOwner!=null){ -nativeClass=superCaller.claxxOwner; -}else if(superCaller.exClazz!=null){ -nativeClass=superCaller.exClazz; -} -} -var st=new StackTraceElement( -((nativeClass!=null&&nativeClass.__CLASS_NAME__.length!=0)? -nativeClass.__CLASS_NAME__:"anonymous"), -((superCaller.exName==null)?"anonymous":superCaller.exName) -+" ("+Clazz_getParamsType(superCaller.arguments)+")", -null,-1); -st.nativeClazz=nativeClass; -this.stackTrace[this.stackTrace.length]=st; -for(var i=0;i":this.declaringClass; -}); -Clazz_defineMethod(c$,"getFileName", -function(){ -return this.fileName; -}); -Clazz_defineMethod(c$,"getLineNumber", -function(){ -return this.lineNumber; -}); -Clazz_defineMethod(c$,"getMethodName", -function(){ -return(this.methodName==null)?"":this.methodName; -}); -Clazz_overrideMethod(c$,"hashCode", -function(){ -if(this.methodName==null){ -return 0; -}return this.methodName.hashCode()^this.declaringClass.hashCode(); -}); -Clazz_defineMethod(c$,"isNativeMethod", -function(){ -return this.lineNumber==-2; -}); -Clazz_overrideMethod(c$,"toString", -function(){ -var buf=new StringBuilder(80); -buf.append(this.getClassName()); -buf.append('.'); -buf.append(this.getMethodName()); -if(this.isNativeMethod()){ -buf.append("(Native Method)"); -}else{ -var fName=this.getFileName(); -if(fName==null){ -buf.append("(Unknown Source)"); -}else{ -var lineNum=this.getLineNumber(); -buf.append('('); -buf.append(fName); -if(lineNum>=0){ -buf.append(':'); -buf.append(lineNum); -}buf.append(')'); -}}return buf.toString(); -}); -TypeError.prototype.getMessage || (TypeError.prototype.getMessage = function(){ return (this.message || this.toString()) + (this.getStackTrace ? this.getStackTrace() : Clazz_getStackTrace())}); -c$=Clazz_declareType(java.lang,"Error",Throwable); - -c$=Clazz_declareType(java.lang,"LinkageError",Error); - -c$=Clazz_declareType(java.lang,"IncompatibleClassChangeError",LinkageError); - -c$=Clazz_declareType(java.lang,"AbstractMethodError",IncompatibleClassChangeError); - -c$=Clazz_declareType(java.lang,"AssertionError",Error); -Clazz_makeConstructor(c$, -function(detailMessage){ -Clazz_superConstructor(this,AssertionError,[String.valueOf(detailMessage),(Clazz_instanceOf(detailMessage,Throwable)?detailMessage:null)]); -},"~O"); -Clazz_makeConstructor(c$, -function(detailMessage){ -this.construct("" + detailMessage); -},"~B"); -Clazz_makeConstructor(c$, -function(detailMessage){ -this.construct("" + detailMessage); -},"~N"); - -c$=Clazz_declareType(java.lang,"ClassCircularityError",LinkageError); - -c$=Clazz_declareType(java.lang,"ClassFormatError",LinkageError); - -c$=Clazz_decorateAsClass(function(){ -this.exception=null; -Clazz_instantialize(this,arguments); -},java.lang,"ExceptionInInitializerError",LinkageError); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,ExceptionInInitializerError); -this.initCause(null); -}); -Clazz_makeConstructor(c$, -function(detailMessage){ -Clazz_superConstructor(this,ExceptionInInitializerError,[detailMessage]); -this.initCause(null); -},"~S"); -Clazz_makeConstructor(c$, -function(exception){ -Clazz_superConstructor(this,ExceptionInInitializerError); -this.exception=exception; -this.initCause(exception); -},"Throwable"); -Clazz_defineMethod(c$,"getException", -function(){ -return this.exception; -}); -Clazz_overrideMethod(c$,"getCause", -function(){ -return this.exception; -}); - -c$=Clazz_declareType(java.lang,"IllegalAccessError",IncompatibleClassChangeError); - -c$=Clazz_declareType(java.lang,"InstantiationError",IncompatibleClassChangeError); - -c$=Clazz_declareType(java.lang,"VirtualMachineError",Error); - -c$=Clazz_declareType(java.lang,"InternalError",VirtualMachineError); - -c$=Clazz_declareType(java.lang,"NoClassDefFoundError",LinkageError); - -c$=Clazz_declareType(java.lang,"NoSuchFieldError",IncompatibleClassChangeError); - -c$=Clazz_declareType(java.lang,"NoSuchMethodError",IncompatibleClassChangeError); - -c$=Clazz_declareType(java.lang,"OutOfMemoryError",VirtualMachineError); - -c$=Clazz_declareType(java.lang,"StackOverflowError",VirtualMachineError); - -c$=Clazz_declareType(java.lang,"UnknownError",VirtualMachineError); - -c$=Clazz_declareType(java.lang,"UnsatisfiedLinkError",LinkageError); - -c$=Clazz_declareType(java.lang,"UnsupportedClassVersionError",ClassFormatError); - -c$=Clazz_declareType(java.lang,"VerifyError",LinkageError); - -c$=Clazz_declareType(java.lang,"ThreadDeath",Error); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,ThreadDeath,[]); -}); - -c$=Clazz_declareType(java.lang,"Exception",Throwable); - -c$=Clazz_declareType(java.lang,"RuntimeException",Exception); - -c$=Clazz_declareType(java.lang,"ArithmeticException",RuntimeException); - -c$=Clazz_declareType(java.lang,"IndexOutOfBoundsException",RuntimeException); - -c$=Clazz_declareType(java.lang,"ArrayIndexOutOfBoundsException",IndexOutOfBoundsException); -Clazz_makeConstructor(c$, -function(index){ -Clazz_superConstructor(this,ArrayIndexOutOfBoundsException,["Array index out of range: "+index]); -},"~N"); - -c$=Clazz_declareType(java.lang,"ArrayStoreException",RuntimeException); - -c$=Clazz_declareType(java.lang,"ClassCastException",RuntimeException); - -c$=Clazz_decorateAsClass(function(){ -this.ex=null; -Clazz_instantialize(this,arguments); -},java.lang,"ClassNotFoundException",Exception); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,ClassNotFoundException,[Clazz_castNullAs("Throwable")]); -}); -Clazz_makeConstructor(c$, -function(detailMessage){ -Clazz_superConstructor(this,ClassNotFoundException,[detailMessage,null]); -},"~S"); -Clazz_makeConstructor(c$, -function(detailMessage,exception){ -Clazz_superConstructor(this,ClassNotFoundException,[detailMessage]); -this.ex=exception; -},"~S,Throwable"); -Clazz_defineMethod(c$,"getException", -function(){ -return this.ex; -}); -Clazz_overrideMethod(c$,"getCause", -function(){ -return this.ex; -}); - -c$=Clazz_declareType(java.lang,"CloneNotSupportedException",Exception); - -c$=Clazz_declareType(java.lang,"IllegalAccessException",Exception); - -c$=Clazz_declareType(java.lang,"IllegalArgumentException",RuntimeException); -Clazz_makeConstructor(c$, -function(cause){ -Clazz_superConstructor(this,IllegalArgumentException,[(cause==null?null:cause.toString()),cause]); -},"Throwable"); - -c$=Clazz_declareType(java.lang,"IllegalMonitorStateException",RuntimeException); - -c$=Clazz_declareType(java.lang,"IllegalStateException",RuntimeException); -Clazz_makeConstructor(c$, -function(cause){ -Clazz_superConstructor(this,IllegalStateException,[(cause==null?null:cause.toString()),cause]); -},"Throwable"); - -c$=Clazz_declareType(java.lang,"IllegalThreadStateException",IllegalArgumentException); - -c$=Clazz_declareType(java.lang,"InstantiationException",Exception); - -c$=Clazz_declareType(java.lang,"InterruptedException",Exception); - -c$=Clazz_declareType(java.lang,"NegativeArraySizeException",RuntimeException); - -c$=Clazz_declareType(java.lang,"NoSuchFieldException",Exception); - -c$=Clazz_declareType(java.lang,"NoSuchMethodException",Exception); - -c$=Clazz_declareType(java.lang,"NullPointerException",RuntimeException); - -c$=Clazz_declareType(java.lang,"NumberFormatException",IllegalArgumentException); - -c$=Clazz_declareType(java.lang,"SecurityException",RuntimeException); -Clazz_makeConstructor(c$, -function(cause){ -Clazz_superConstructor(this,SecurityException,[(cause==null?null:cause.toString()),cause]); -},"Throwable"); - -c$=Clazz_declareType(java.lang,"StringIndexOutOfBoundsException",IndexOutOfBoundsException); -Clazz_makeConstructor(c$, -function(index){ -Clazz_superConstructor(this,StringIndexOutOfBoundsException,["String index out of range: "+index]); -},"~N"); - -c$=Clazz_declareType(java.lang,"UnsupportedOperationException",RuntimeException); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,UnsupportedOperationException,[]); -}); -Clazz_makeConstructor(c$, -function(cause){ -Clazz_superConstructor(this,UnsupportedOperationException,[(cause==null?null:cause.toString()),cause]); -},"Throwable"); - -c$=Clazz_decorateAsClass(function(){ -this.target=null; -Clazz_instantialize(this,arguments); -},java.lang.reflect,"InvocationTargetException",Exception); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[Clazz_castNullAs("Throwable")]); -}); -Clazz_makeConstructor(c$, -function(exception){ -Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[null,exception]); -this.target=exception; -},"Throwable"); -Clazz_makeConstructor(c$, -function(exception,detailMessage){ -Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[detailMessage,exception]); -this.target=exception; -},"Throwable,~S"); -Clazz_defineMethod(c$,"getTargetException", -function(){ -return this.target; -}); -Clazz_overrideMethod(c$,"getCause", -function(){ -return this.target; -}); - -c$=Clazz_decorateAsClass(function(){ -this.undeclaredThrowable=null; -Clazz_instantialize(this,arguments); -},java.lang.reflect,"UndeclaredThrowableException",RuntimeException); -Clazz_makeConstructor(c$, -function(exception){ -Clazz_superConstructor(this,java.lang.reflect.UndeclaredThrowableException); -this.undeclaredThrowable=exception; -this.initCause(exception); -},"Throwable"); -Clazz_makeConstructor(c$, -function(exception,detailMessage){ -Clazz_superConstructor(this,java.lang.reflect.UndeclaredThrowableException,[detailMessage]); -this.undeclaredThrowable=exception; -this.initCause(exception); -},"Throwable,~S"); -Clazz_defineMethod(c$,"getUndeclaredThrowable", -function(){ -return this.undeclaredThrowable; -}); -Clazz_overrideMethod(c$,"getCause", -function(){ -return this.undeclaredThrowable; -}); - -c$=Clazz_declareType(java.io,"IOException",Exception); - - -c$=Clazz_declareType(java.io,"CharConversionException",java.io.IOException); - -c$=Clazz_declareType(java.io,"EOFException",java.io.IOException); - -c$=Clazz_declareType(java.io,"FileNotFoundException",java.io.IOException); - -c$=Clazz_decorateAsClass(function(){ -this.bytesTransferred=0; -Clazz_instantialize(this,arguments); -},java.io,"InterruptedIOException",java.io.IOException); - -c$=Clazz_declareType(java.io,"ObjectStreamException",java.io.IOException); - -c$=Clazz_decorateAsClass(function(){ -this.classname=null; -Clazz_instantialize(this,arguments); -},java.io,"InvalidClassException",java.io.ObjectStreamException); -Clazz_makeConstructor(c$, -function(className,detailMessage){ -Clazz_superConstructor(this,java.io.InvalidClassException,[detailMessage]); -this.classname=className; -},"~S,~S"); -Clazz_defineMethod(c$,"getMessage", -function(){ -var msg=Clazz_superCall(this,java.io.InvalidClassException,"getMessage",[]); -if(this.classname!=null){ -msg=this.classname+';' + ' '+msg; -}return msg; -}); - -c$=Clazz_declareType(java.io,"InvalidObjectException",java.io.ObjectStreamException); - -c$=Clazz_declareType(java.io,"NotActiveException",java.io.ObjectStreamException); - -c$=Clazz_declareType(java.io,"NotSerializableException",java.io.ObjectStreamException); - -c$=Clazz_decorateAsClass(function(){ -this.eof=false; -this.length=0; -Clazz_instantialize(this,arguments); -},java.io,"OptionalDataException",java.io.ObjectStreamException); - -c$=Clazz_declareType(java.io,"StreamCorruptedException",java.io.ObjectStreamException); - -c$=Clazz_declareType(java.io,"SyncFailedException",java.io.IOException); - -c$=Clazz_declareType(java.io,"UnsupportedEncodingException",java.io.IOException); - -c$=Clazz_declareType(java.io,"UTFDataFormatException",java.io.IOException); - -c$=Clazz_decorateAsClass(function(){ -this.detail=null; -Clazz_instantialize(this,arguments); -},java.io,"WriteAbortedException",java.io.ObjectStreamException); -Clazz_makeConstructor(c$, -function(detailMessage,rootCause){ -Clazz_superConstructor(this,java.io.WriteAbortedException,[detailMessage]); -this.detail=rootCause; -this.initCause(rootCause); -},"~S,Exception"); -Clazz_defineMethod(c$,"getMessage", -function(){ -var msg=Clazz_superCall(this,java.io.WriteAbortedException,"getMessage",[]); -return (this.detail ? msg + "; "+this.detail.toString() : msg); -}); -Clazz_overrideMethod(c$,"getCause", -function(){ -return this.detail; -}); - -c$=Clazz_declareType(javautil,"ConcurrentModificationException",RuntimeException); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,javautil.ConcurrentModificationException,[]); -}); - -c$=Clazz_declareType(javautil,"EmptyStackException",RuntimeException); - -c$=Clazz_decorateAsClass(function(){ -this.className=null; -this.key=null; -Clazz_instantialize(this,arguments); -},javautil,"MissingResourceException",RuntimeException); -Clazz_makeConstructor(c$, -function(detailMessage,className,resourceName){ -Clazz_superConstructor(this,javautil.MissingResourceException,[detailMessage]); -this.className=className; -this.key=resourceName; -},"~S,~S,~S"); -Clazz_defineMethod(c$,"getClassName", -function(){ -return this.className; -}); -Clazz_defineMethod(c$,"getKey", -function(){ -return this.key; -}); - -c$=Clazz_declareType(javautil,"NoSuchElementException",RuntimeException); - -c$=Clazz_declareType(javautil,"TooManyListenersException",Exception); - -c$=Clazz_declareType(java.lang,"Void"); -Clazz_defineStatics(c$, -"TYPE",null); -{ -java.lang.Void.TYPE=java.lang.Void; -}Clazz_declareInterface(java.lang.reflect,"GenericDeclaration"); -Clazz_declareInterface(java.lang.reflect,"AnnotatedElement"); - -c$=Clazz_declareType(java.lang.reflect,"AccessibleObject",null,java.lang.reflect.AnnotatedElement); -Clazz_makeConstructor(c$, -function(){ -}); -Clazz_defineMethod(c$,"isAccessible", -function(){ -return false; -}); -c$.setAccessible=Clazz_defineMethod(c$,"setAccessible", -function(objects,flag){ -return; -},"~A,~B"); -Clazz_defineMethod(c$,"setAccessible", -function(flag){ -return; -},"~B"); -Clazz_overrideMethod(c$,"isAnnotationPresent", -function(annotationType){ -return false; -},"Class"); -Clazz_overrideMethod(c$,"getDeclaredAnnotations", -function(){ -return new Array(0); -}); -Clazz_overrideMethod(c$,"getAnnotations", -function(){ -return new Array(0); -}); -Clazz_overrideMethod(c$,"getAnnotation", -function(annotationType){ -return null; -},"Class"); -c$.marshallArguments=Clazz_defineMethod(c$,"marshallArguments", -function(parameterTypes,args){ -return null; -},"~A,~A"); -Clazz_defineMethod(c$,"invokeV", -function(receiver,args){ -return; -},"~O,~A"); -Clazz_defineMethod(c$,"invokeL", -function(receiver,args){ -return null; -},"~O,~A"); -Clazz_defineMethod(c$,"invokeI", -function(receiver,args){ -return 0; -},"~O,~A"); -Clazz_defineMethod(c$,"invokeJ", -function(receiver,args){ -return 0; -},"~O,~A"); -Clazz_defineMethod(c$,"invokeF", -function(receiver,args){ -return 0.0; -},"~O,~A"); -Clazz_defineMethod(c$,"invokeD", -function(receiver,args){ -return 0.0; -},"~O,~A"); -c$.emptyArgs=c$.prototype.emptyArgs=new Array(0); -Clazz_declareInterface(java.lang.reflect,"InvocationHandler"); -c$=Clazz_declareInterface(java.lang.reflect,"Member"); -Clazz_defineStatics(c$, -"PUBLIC",0, -"DECLARED",1); - -c$=Clazz_declareType(java.lang.reflect,"Modifier"); -Clazz_makeConstructor(c$, -function(){ -}); -c$.isAbstract=Clazz_defineMethod(c$,"isAbstract", -function(modifiers){ -return((modifiers&1024)!=0); -},"~N"); -c$.isFinal=Clazz_defineMethod(c$,"isFinal", -function(modifiers){ -return((modifiers&16)!=0); -},"~N"); -c$.isInterface=Clazz_defineMethod(c$,"isInterface", -function(modifiers){ -return((modifiers&512)!=0); -},"~N"); -c$.isNative=Clazz_defineMethod(c$,"isNative", -function(modifiers){ -return((modifiers&256)!=0); -},"~N"); -c$.isPrivate=Clazz_defineMethod(c$,"isPrivate", -function(modifiers){ -return((modifiers&2)!=0); -},"~N"); -c$.isProtected=Clazz_defineMethod(c$,"isProtected", -function(modifiers){ -return((modifiers&4)!=0); -},"~N"); -c$.isPublic=Clazz_defineMethod(c$,"isPublic", -function(modifiers){ -return((modifiers&1)!=0); -},"~N"); -c$.isStatic=Clazz_defineMethod(c$,"isStatic", -function(modifiers){ -return((modifiers&8)!=0); -},"~N"); -c$.isStrict=Clazz_defineMethod(c$,"isStrict", -function(modifiers){ -return((modifiers&2048)!=0); -},"~N"); -c$.isSynchronized=Clazz_defineMethod(c$,"isSynchronized", -function(modifiers){ -return((modifiers&32)!=0); -},"~N"); -c$.isTransient=Clazz_defineMethod(c$,"isTransient", -function(modifiers){ -return((modifiers&128)!=0); -},"~N"); -c$.isVolatile=Clazz_defineMethod(c$,"isVolatile", -function(modifiers){ -return((modifiers&64)!=0); -},"~N"); -c$.toString=Clazz_defineMethod(c$,"toString", -function(modifiers){ -var sb=new Array(0); -if(java.lang.reflect.Modifier.isPublic(modifiers))sb[sb.length]="public"; -if(java.lang.reflect.Modifier.isProtected(modifiers))sb[sb.length]="protected"; -if(java.lang.reflect.Modifier.isPrivate(modifiers))sb[sb.length]="private"; -if(java.lang.reflect.Modifier.isAbstract(modifiers))sb[sb.length]="abstract"; -if(java.lang.reflect.Modifier.isStatic(modifiers))sb[sb.length]="static"; -if(java.lang.reflect.Modifier.isFinal(modifiers))sb[sb.length]="final"; -if(java.lang.reflect.Modifier.isTransient(modifiers))sb[sb.length]="transient"; -if(java.lang.reflect.Modifier.isVolatile(modifiers))sb[sb.length]="volatile"; -if(java.lang.reflect.Modifier.isSynchronized(modifiers))sb[sb.length]="synchronized"; -if(java.lang.reflect.Modifier.isNative(modifiers))sb[sb.length]="native"; -if(java.lang.reflect.Modifier.isStrict(modifiers))sb[sb.length]="strictfp"; -if(java.lang.reflect.Modifier.isInterface(modifiers))sb[sb.length]="interface"; -if(sb.length>0){ -return sb.join(" "); -}return""; -},"~N"); -Clazz_defineStatics(c$, -"PUBLIC",0x1, -"PRIVATE",0x2, -"PROTECTED",0x4, -"STATIC",0x8, -"FINAL",0x10, -"SYNCHRONIZED",0x20, -"VOLATILE",0x40, -"TRANSIENT",0x80, -"NATIVE",0x100, -"INTERFACE",0x200, -"ABSTRACT",0x400, -"STRICT",0x800, -"BRIDGE",0x40, -"VARARGS",0x80, -"SYNTHETIC",0x1000, -"ANNOTATION",0x2000, -"ENUM",0x4000); - -c$=Clazz_decorateAsClass(function(){ -this.clazz=null; -this.parameterTypes=null; -this.exceptionTypes=null; -this.modifiers=0; -Clazz_instantialize(this,arguments); -},java.lang.reflect,"Constructor",java.lang.reflect.AccessibleObject,[java.lang.reflect.GenericDeclaration,java.lang.reflect.Member]); -Clazz_makeConstructor(c$, -function(declaringClass,parameterTypes,checkedExceptions,modifiers){ -Clazz_superConstructor(this,java.lang.reflect.Constructor,[]); -this.clazz=declaringClass; -this.parameterTypes=parameterTypes; -this.exceptionTypes=checkedExceptions; -this.modifiers=modifiers; -},"Class,~A,~A,~N"); -Clazz_overrideMethod(c$,"getTypeParameters", -function(){ -return null; -}); -Clazz_defineMethod(c$,"toGenericString", -function(){ -return null; -}); -Clazz_defineMethod(c$,"getGenericParameterTypes", -function(){ -return null; -}); -Clazz_defineMethod(c$,"getGenericExceptionTypes", -function(){ -return null; -}); -Clazz_defineMethod(c$,"getParameterAnnotations", -function(){ -return null; -}); -Clazz_defineMethod(c$,"isVarArgs", -function(){ -return false; -}); -Clazz_overrideMethod(c$,"isSynthetic", -function(){ -return false; -}); -Clazz_overrideMethod(c$,"equals", -function(object){ -if(object!=null&&Clazz_instanceOf(object,java.lang.reflect.Constructor)){ -var other=object; -if(this.getDeclaringClass()===other.getDeclaringClass()){ -var params1=this.parameterTypes; -var params2=other.parameterTypes; -if(params1.length==params2.length){ -for(var i=0;i 0 ? x - 0x10000 : x); +}); + +Clazz_defineMethod(Number,"byteValue", +function(){ +var x = Math.round(this)&0xff; +return (this < 0 && x > 0 ? x - 0x100 : x); +}); + +Clazz_defineMethod(Number,"intValue", +function(){ +return Math.round(this)&0xffffffff; +}); + +Clazz_defineMethod(Number,"longValue", +function(){ +return Math.round(this); +}); + +Clazz_defineMethod(Number,"floatValue", +function(){ +return this.valueOf(); +}); +Clazz_defineMethod(Number,"doubleValue", +function(){ +return parseFloat(this.valueOf()); +}); + +Clazz_overrideMethod(Number,"hashCode", +function(){ +return this.valueOf(); +}); + +java.lang.Integer=Integer=function(){ +Clazz_instantialize(this,arguments); +}; +Clazz_decorateAsType(Integer,"Integer",Number,Comparable,null,true); +Integer.prototype.valueOf=function(){return 0;}; +Integer.toString=Integer.prototype.toString=function(){ +if(arguments.length!=0){ +return""+arguments[0]; +} else if(this===Integer){ +return"class java.lang.Integer"; +} +return""+this.valueOf(); +}; + +/* + +Clazz_makeConstructor(Integer, +function(){ +this.valueOf=function(){ +return 0; +}; +}); +*/ + + +Clazz_overrideConstructor(Integer, function(v){ + v == null && (v = 0); + if (typeof v != "number") + v = Integer.parseIntRadix(v, 10); + this.valueOf=function(){return v;}; +}); //BH +/* +Clazz_makeConstructor(Integer, +function(s){ +var value=Integer.parseInt(s,10); +this.valueOf=function(){ +return value; +}; +},"String"); +*/ +Integer.MIN_VALUE=Integer.prototype.MIN_VALUE=-0x80000000; +Integer.MAX_VALUE=Integer.prototype.MAX_VALUE=0x7fffffff; +Integer.TYPE=Integer.prototype.TYPE=Integer; + + +Clazz_defineMethod(Integer,"bitCount", +function(i) { + i = i - ((i >>> 1) & 0x55555555); + i = (i & 0x33333333) + ((i >>> 2) & 0x33333333); + i = (i + (i >>> 4)) & 0x0f0f0f0f; + i = i + (i >>> 8); + i = i + (i >>> 16); + return i & 0x3f; +},"Number"); +Integer.bitCount=Integer.prototype.bitCount; + +Clazz_defineMethod(Integer,"numberOfLeadingZeros", +function(i) { + if (i == 0) return 32; + var n = 1; + if (i >>> 16 == 0) { n += 16; i <<= 16; } + if (i >>> 24 == 0) { n += 8; i <<= 8; } + if (i >>> 28 == 0) { n += 4; i <<= 4; } + if (i >>> 30 == 0) { n += 2; i <<= 2; } + n -= i >>> 31; + return n; +},"Number"); +Integer.numberOfLeadingZeros=Integer.prototype.numberOfLeadingZeros; + +Clazz_defineMethod(Integer,"numberOfTrailingZeros", +function(i) { + if (i == 0) return 32; + var n = 31; + var y = i <<16; if (y != 0) { n = n -16; i = y; } + y = i << 8; if (y != 0) { n = n - 8; i = y; } + y = i << 4; if (y != 0) { n = n - 4; i = y; } + y = i << 2; if (y != 0) { n = n - 2; i = y; } + return n - ((i << 1) >>> 31); +},"Number"); +Integer.numberOfTrailingZeros=Integer.prototype.numberOfTrailingZeros; + +Clazz_defineMethod(Integer,"parseIntRadix", +function(s,radix){ +if(s==null){ +throw new NumberFormatException("null"); +}if(radix<2){ +throw new NumberFormatException("radix "+radix+" less than Character.MIN_RADIX"); +}if(radix>36){ +throw new NumberFormatException("radix "+radix+" greater than Character.MAX_RADIX"); +} +if (radix == 10) { + for (var i = s.length; --i >= 0;) { + var c = s.charCodeAt(i); + if (c >= 48 && c <= 57) continue; + if (i > 0 || c != 43 && c != 45) + throw new NumberFormatException("Not a Number : "+s); + + } +} +var i=parseInt(s,radix); +if(isNaN(i)){ +throw new NumberFormatException("Not a Number : "+s); +} +return i; +},"String, Number"); +Integer.parseIntRadix=Integer.prototype.parseIntRadix; + +Clazz_defineMethod(Integer,"parseInt", +function(s){ +return Integer.parseIntRadix(s,10); +},"String"); +Integer.parseInt=Integer.prototype.parseInt; + +/* +Clazz_defineMethod(Integer,"$valueOf", +function(s){ +return new Integer(Integer.parseIntRadix(s,10)); +},"String"); +*/ + +Clazz_overrideMethod(Integer,"$valueOf", +function(s){ +return new Integer(s); +}); + +/* +Clazz_defineMethod(Integer,"$valueOf", +function(s,r){ +return new Integer(Integer.parseIntRadix(s,r)); +},"String, Number"); +*/ + +Integer.$valueOf=Integer.prototype.$valueOf; + + +Clazz_overrideMethod(Integer,"equals", +function(s){ +if(s==null||!Clazz_instanceOf(s,Integer)){ +return false; +} +return s.valueOf()==this.valueOf(); +},"Object"); +Integer.toHexString=Integer.prototype.toHexString=function(d){ +if(d.valueOf)d=d.valueOf(); +if (d < 0) { +var b = d & 0xFFFFFF; +var c = ((d>>24)&0xFF); +return c._numberToString(16) + (b = "000000" + b._numberToString(16)).substring(b.length - 6); +} +return d._numberToString(16);}; +Integer.toOctalString=Integer.prototype.toOctalString=function(d){if(d.valueOf)d=d.valueOf();return d._numberToString(8);}; +Integer.toBinaryString=Integer.prototype.toBinaryString=function(d){if(d.valueOf)d=d.valueOf();return d._numberToString(2);}; + +Integer.decodeRaw=Clazz_defineMethod(Integer,"decodeRaw", function(n){ +if (n.indexOf(".") >= 0)n = ""; +var i = (n.startsWith("-") ? 1 : 0); +n = n.replace(/\#/, "0x").toLowerCase(); +var radix=(n.startsWith("0x", i) ? 16 : n.startsWith("0", i) ? 8 : 10); +// The general problem with parseInt is that is not strict -- ParseInt("10whatever") == 10. +// Number is strict, but Number("055") does not work, though ParseInt("055", 8) does. +// need to make sure negative numbers are negative +n = Number(n) & 0xFFFFFFFF; +return (radix == 8 ? parseInt(n, 8) : n); +},"~S"); + +Integer.decode=Clazz_defineMethod(Integer,"decode", function(n){ + n = Integer.decodeRaw(n); + if (isNaN(n) || n < Integer.MIN_VALUE|| n > Integer.MAX_VALUE) + throw new NumberFormatException("Invalid Integer"); + return new Integer(n); +},"~S"); + +Clazz_overrideMethod(Integer,"hashCode", +function(){ +return this.valueOf(); +}); + +// Note that Long is problematic in JavaScript + +java.lang.Long=Long=function(){ +Clazz_instantialize(this,arguments); +}; +Clazz_decorateAsType(Long,"Long",Number,Comparable,null,true); +Long.prototype.valueOf=function(){return 0;}; +Long.toString=Long.prototype.toString=function(){ +if(arguments.length!=0){ +return""+arguments[0]; +}else if(this===Long){ +return"class java.lang.Long"; +} +return""+this.valueOf(); +}; + +Clazz_overrideConstructor(Long, function(v){ + v == null && (v = 0); + v = (typeof v == "number" ? Math.round(v) : Integer.parseIntRadix(v, 10)); +this.valueOf=function(){return v;}; +}); + +//Long.MIN_VALUE=Long.prototype.MIN_VALUE=-0x8000000000000000; +//Long.MAX_VALUE=Long.prototype.MAX_VALUE=0x7fffffffffffffff; +Long.TYPE=Long.prototype.TYPE=Long; + +Clazz_defineMethod(Long,"parseLong", +function(s,radix){ + return Integer.parseInt(s, radix || 10); +}); + +Long.parseLong=Long.prototype.parseLong; + +Clazz_overrideMethod(Long,"$valueOf", +function(s){ +return new Long(s); +}); +/* +Clazz_defineMethod(Long,"$valueOf", +function(s){ +return new Long(s); +},"Number"); + +Clazz_defineMethod(Long,"$valueOf", +function(s,r){ +return new Long(Long.parseLong(s,r)); +},"String, Number"); +*/ +Long.$valueOf=Long.prototype.$valueOf; +Clazz_overrideMethod(Long,"equals", +function(s){ +if(s==null||!Clazz_instanceOf(s,Long)){ +return false; +} +return s.valueOf()==this.valueOf(); +},"Object"); +Long.toHexString=Long.prototype.toHexString=function(i){ +return i.toString(16); +}; +Long.toOctalString=Long.prototype.toOctalString=function(i){ +return i.toString(8); +}; +Long.toBinaryString=Long.prototype.toBinaryString=function(i){ +return i.toString(2); +}; + + +Long.decode=Clazz_defineMethod(Long,"decode", +function(n){ + n = Integer.decodeRaw(n); + if (isNaN(n)) + throw new NumberFormatException("Invalid Long"); + return new Long(n); +},"~S"); + +java.lang.Short = Short = function () { +Clazz_instantialize (this, arguments); +}; +Clazz_decorateAsType (Short, "Short", Number, Comparable, null, true); +Short.prototype.valueOf = function () { return 0; }; +Short.toString = Short.prototype.toString = function () { + if (arguments.length != 0) { + return "" + arguments[0]; + } else if (this === Short) { + return "class java.lang.Short"; // Short.class.toString + } + return "" + this.valueOf (); +}; + +Clazz_overrideConstructor(Short, +function (v) { + v == null && (v = 0); + if (typeof v != "number") + v = Integer.parseIntRadix(v, 10); + v = v.shortValue(); + this.valueOf = function () {return v;}; +}); + + +Short.MIN_VALUE = Short.prototype.MIN_VALUE = -32768; +Short.MAX_VALUE = Short.prototype.MAX_VALUE = 32767; +Short.TYPE = Short.prototype.TYPE = Short; + +Clazz_defineMethod(Short, "parseShortRadix", +function (s, radix) { +return Integer.parseIntRadix(s, radix).shortValue(); +}, "String, Number"); +Short.parseShortRadix = Short.prototype.parseShortRadix; + +Clazz_defineMethod(Short, "parseShort", +function (s) { +return Short.parseShortRadix (s, 10); +}, "String"); + +Short.parseShort = Short.prototype.parseShort; + +/* +Clazz_defineMethod(Short, "$valueOf", +function (s) { +return new Short(Short.parseShort (s, 10)); +}, "String"); + */ + +Clazz_overrideMethod(Short, "$valueOf", +function (s) { +return new Short(s); +}); + +/* +Clazz_defineMethod(Short, "$valueOf", +function (s, r) { +return new Short(Short.parseShort (s, r)); +}, "String, Number"); + */ + +Short.$valueOf = Short.prototype.$valueOf; +Clazz_overrideMethod(Short, "equals", +function (s) { +if(s == null || !Clazz_instanceOf(s, Short) ){ + return false; +} +return s.valueOf() == this.valueOf(); +}, "Object"); +Short.toHexString = Short.prototype.toHexString = function (i) { + return i.toString (16); +}; +Short.toOctalString = Short.prototype.toOctalString = function (i) { + return i.toString (8); +}; +Short.toBinaryString = Short.prototype.toBinaryString = function (i) { + return i.toString (2); +}; +Short.decode = Clazz_defineMethod(Short, "decode", +function(n){ + n = Integer.decodeRaw(n); + if (isNaN(n) || n < -32768|| n > 32767) + throw new NumberFormatException("Invalid Short"); + return new Short(n); +}, "~S"); + +java.lang.Byte=Byte=function(){ +Clazz_instantialize(this,arguments); +}; +Clazz_decorateAsType(Byte,"Byte",Number,Comparable,null,true); +Byte.prototype.valueOf=function(){return 0;}; +Byte.toString=Byte.prototype.toString=function(){ +if(arguments.length!=0){ +return""+arguments[0]; +}else if(this===Byte){ +return"class java.lang.Byte"; +} +return""+this.valueOf(); +}; +Clazz_makeConstructor(Byte, +function(v){ + if (typeof v != "number") + v = Integer.parseIntRadix(v, 10); + v = v.byteValue(); +this.valueOf=function(){ +return v; +}; +}); + +Byte.serialVersionUID=Byte.prototype.serialVersionUID=-7183698231559129828; +Byte.MIN_VALUE=Byte.prototype.MIN_VALUE=-128; +Byte.MAX_VALUE=Byte.prototype.MAX_VALUE=127; +Byte.SIZE=Byte.prototype.SIZE=8; +Byte.TYPE=Byte.prototype.TYPE=Byte; + +Clazz_defineMethod(Byte,"parseByteRadix", +function(s,radix){ + return Integer.parseIntRadix(s, radix).byteValue(); +},"String, Number"); +Byte.parseByteRadix=Byte.prototype.parseByteRadix; + +Clazz_defineMethod(Byte,"parseByte", +function(s){ +return Byte.parseByte(s,10); +},"String"); + +Byte.parseByte=Byte.prototype.parseByte; + +Clazz_overrideMethod(Byte, "$valueOf", +function (s) { +return new Byte(s); +}); + +Byte.$valueOf=Byte.prototype.$valueOf; +Clazz_overrideMethod(Byte,"equals", +function(s){ +if(s==null||!Clazz_instanceOf(s,Byte)){ +return false; +} +return s.valueOf()==this.valueOf(); +},"Object"); +Byte.toHexString=Byte.prototype.toHexString=function(i){ +return i.toString(16); +}; +Byte.toOctalString=Byte.prototype.toOctalString=function(i){ +return i.toString(8); +}; +Byte.toBinaryString=Byte.prototype.toBinaryString=function(i){ +return i.toString(2); +}; +Byte.decode=Clazz_defineMethod(Byte,"decode", +function(n){ + n = Integer.decodeRaw(n); + if (isNaN(n) || n < -128|| n > 127) + throw new NumberFormatException("Invalid Byte"); +return new Byte(n); +},"~S"); + +Clazz._floatToString = function(f) { + var s = ""+f + if (s.indexOf(".") < 0 && s.indexOf("e") < 0) + s += ".0"; + return s; +} + +java.lang.Float=Float=function(){ +Clazz_instantialize(this,arguments); +}; +Clazz_decorateAsType(Float,"Float",Number,Comparable,null,true); +Float.prototype.valueOf=function(){return 0;}; +Float.toString=Float.prototype.toString=function(){ +if(arguments.length!=0){ +return Clazz._floatToString(arguments[0]); +}else if(this===Float){ +return"class java.lang.Float"; +} +return Clazz._floatToString(this.valueOf()); +}; + +Clazz_overrideConstructor(Float, function(v){ + v == null && (v = 0); + if (typeof v != "number") + v = Number(v); + this.valueOf=function(){return v;} +}); + +Float.serialVersionUID=Float.prototype.serialVersionUID=-2671257302660747028; +Float.MIN_VALUE=Float.prototype.MIN_VALUE=3.4028235e+38; +Float.MAX_VALUE=Float.prototype.MAX_VALUE=1.4e-45; +Float.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY; +Float.POSITIVE_INFINITY=Number.POSITIVE_INFINITY; +Float.NaN=Number.NaN; +Float.TYPE=Float.prototype.TYPE=Float; + +Clazz_defineMethod(Float,"parseFloat", +function(s){ +if(s==null){ +throw new NumberFormatException("null"); +} +if (typeof s == "number")return s; // important -- typeof NaN is "number" and is OK here +var floatVal=Number(s); +if(isNaN(floatVal)){ +throw new NumberFormatException("Not a Number : "+s); +} +return floatVal; +},"String"); +Float.parseFloat=Float.prototype.parseFloat; + +Clazz_overrideMethod(Float,"$valueOf", +function(s){ +return new Float(s); +}); + +Float.$valueOf=Float.prototype.$valueOf; + +Clazz_defineMethod(Float,"isNaN", +function(num){ +return isNaN(num); +},"Number"); +Float.isNaN=Float.prototype.isNaN; +Clazz_defineMethod(Float,"isInfinite", +function(num){ +return!isFinite(num); +},"Number"); +Float.isInfinite=Float.prototype.isInfinite; + +Clazz_overrideMethod(Float,"equals", +function(s){ +if(s==null||!Clazz_instanceOf(s,Float)){ +return false; +} +return s.valueOf()==this.valueOf(); +},"Object"); + +java.lang.Double=Double=function(){ +Clazz_instantialize(this,arguments); +}; +Clazz_decorateAsType(Double,"Double",Number,Comparable,null,true); +Double.prototype.valueOf=function(){return 0;}; +Double.toString=Double.prototype.toString=function(){ +if(arguments.length!=0){ +return Clazz._floatToString(arguments[0]); +}else if(this===Double){ +return"class java.lang.Double"; +} +return Clazz._floatToString(this.valueOf()); +}; + +Clazz_overrideConstructor(Double, function(v){ + v == null && (v = 0); + if (typeof v != "number") + v = Double.parseDouble(v); + this.valueOf=function(){return v;}; +}); // BH + +Double.serialVersionUID=Double.prototype.serialVersionUID=-9172774392245257468; +Double.MIN_VALUE=Double.prototype.MIN_VALUE=4.9e-324; +Double.MAX_VALUE=Double.prototype.MAX_VALUE=1.7976931348623157e+308; +Double.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY; +Double.POSITIVE_INFINITY=Number.POSITIVE_INFINITY; +Double.NaN=Number.NaN; +Double.TYPE=Double.prototype.TYPE=Double; + +Clazz_defineMethod(Double,"isNaN", +function(num){ +return isNaN(num); +},"Number"); +Double.isNaN=Double.prototype.isNaN; +Clazz_defineMethod(Double,"isInfinite", +function(num){ +return!isFinite(num); +},"Number"); +Double.isInfinite=Double.prototype.isInfinite; + +Clazz_defineMethod(Double,"parseDouble", +function(s){ +if(s==null){ +throw new NumberFormatException("null"); +} +if (typeof s == "number")return s; // important -- typeof NaN is "number" and is OK here +var doubleVal=Number(s); +if(isNaN(doubleVal)){ +throw new NumberFormatException("Not a Number : "+s); +} +return doubleVal; +},"String"); +Double.parseDouble=Double.prototype.parseDouble; + +/* +Clazz_defineMethod(Double,"$valueOf", +function(s){ +return new Double(this.parseDouble(s)); +},"String"); +*/ + +Clazz_defineMethod(Double,"$valueOf", +function(v){ +return new Double(v); +},"Number"); + +Double.$valueOf=Double.prototype.$valueOf; + +Clazz_overrideMethod(Double,"equals", +function(s){ +if(s==null||!Clazz_instanceOf(s,Double)){ +return false; +} +return s.valueOf()==this.valueOf(); +},"Object"); + + +//java.lang.B00lean = Boolean; ?? BH why this? +Boolean = java.lang.Boolean = Boolean || function () {Clazz_instantialize (this, arguments);}; +if (Clazz._supportsNativeObject) { + for (var i = 0; i < Clazz._extendedObjectMethods.length; i++) { + var p = Clazz._extendedObjectMethods[i]; + Boolean.prototype[p] = Clazz._O.prototype[p]; + } +} +Boolean.__CLASS_NAME__="Boolean"; +Clazz_implementOf(Boolean,[java.io.Serializable,java.lang.Comparable]); +Boolean.equals=Clazz._innerFunctions.equals; +Boolean.getName=Clazz._innerFunctions.getName; +Boolean.serialVersionUID=Boolean.prototype.serialVersionUID=-3665804199014368530; + +//Clazz_makeConstructor(Boolean, +//function(value){ +//this.valueOf=function(){ +//return value; +//}; +//},"~B"); + +Clazz_overrideConstructor(Boolean, +function(s){ + var b = ((typeof s == "string" ? Boolean.toBoolean(s) : s) ? true : false); + this.valueOf=function(){return b;}; +},"~O"); + +Boolean.parseBoolean=Clazz_defineMethod(Boolean,"parseBoolean", +function(s){ +return Boolean.toBoolean(s); +},"~S"); +Clazz_defineMethod(Boolean,"booleanValue", +function(){ +return this.valueOf(); +}); +Boolean.$valueOf=Clazz_overrideMethod(Boolean,"$valueOf", +function(b){ +return((typeof b == "string"? "true".equalsIgnoreCase(b) : b)?Boolean.TRUE:Boolean.FALSE); +}); + +/* +Boolean.toString=Clazz_defineMethod(Boolean,"toString", +function(b){ +return b?"true":"false"; +},"~B"); +*/ + +Clazz_overrideMethod(Boolean,"toString", +function(){ +return this.valueOf()?"true":"false"; +}); +Clazz_overrideMethod(Boolean,"hashCode", +function(){ +return this.valueOf()?1231:1237; +}); +Clazz_overrideMethod(Boolean,"equals", +function(obj){ +if(Clazz_instanceOf(obj,Boolean)){ +return this.booleanValue()==obj.booleanValue(); +}return false; +},"~O"); +Boolean.getBoolean=Clazz_defineMethod(Boolean,"getBoolean", +function(name){ +var result=false; +try{ +result=Boolean.toBoolean(System.getProperty(name)); +}catch(e){ +if(Clazz_instanceOf(e,IllegalArgumentException)){ +}else if(Clazz_instanceOf(e,NullPointerException)){ +}else{ +throw e; +} +} +return result; +},"~S"); +Clazz_overrideMethod(Boolean,"compareTo", +function(b){ +return(b.value==this.value?0:(this.value?1:-1)); +},"Boolean"); +Boolean.toBoolean=Clazz_defineMethod(Boolean,"toBoolean", +($fz=function(name){ +return((name!=null)&&name.equalsIgnoreCase("true")); +},$fz.isPrivate=true,$fz),"~S"); +Boolean.TRUE=Boolean.prototype.TRUE=new Boolean(true); +Boolean.FALSE=Boolean.prototype.FALSE=new Boolean(false); +Boolean.TYPE=Boolean.prototype.TYPE=Boolean; + + +Clazz._Encoding=new Object(); + +(function(Encoding) { + +Encoding.UTF8="utf-8"; +Encoding.UTF16="utf-16"; +Encoding.ASCII="ascii"; + + +Encoding.guessEncoding=function(str){ +if(str.charCodeAt(0)==0xEF&&str.charCodeAt(1)==0xBB&&str.charCodeAt(2)==0xBF){ +return Encoding.UTF8; +}else if(str.charCodeAt(0)==0xFF&&str.charCodeAt(1)==0xFE){ +return Encoding.UTF16; +}else{ +return Encoding.ASCII; +} +}; + +Encoding.readUTF8=function(str){ +var encoding=this.guessEncoding(str); +var startIdx=0; +if(encoding==Encoding.UTF8){ +startIdx=3; +}else if(encoding==Encoding.UTF16){ +startIdx=2; +} +var arrs=new Array(); +for(var i=startIdx;i0xc0&&charCode<0xe0){ +var c1=charCode&0x1f; +i++; +var c2=str.charCodeAt(i)&0x3f; +var c=(c1<<6)+c2; +arrs[arrs.length]=String.fromCharCode(c); +}else if(charCode>=0xe0){ +var c1=charCode&0x0f; +i++; +var c2=str.charCodeAt(i)&0x3f; +i++; +var c3=str.charCodeAt(i)&0x3f; +var c=(c1<<12)+(c2<<6)+c3; +arrs[arrs.length]=String.fromCharCode(c); +} +} +return arrs.join(''); +}; + +Encoding.convert2UTF8=function(str){ +var encoding=this.guessEncoding(str); +var startIdx=0; +if(encoding==Encoding.UTF8){ +return str; +}else if(encoding==Encoding.UTF16){ +startIdx=2; +} + +var offset=0; +var arrs=new Array(offset+str.length-startIdx); + +for(var i=startIdx;i>6); +var c2=0x80+(charCode&0x003f); +arrs[offset+i-startIdx]=String.fromCharCode(c1)+String.fromCharCode(c2); +}else{ +var c1=0xe0+((charCode&0xf000)>>12); +var c2=0x80+((charCode&0x0fc0)>>6); +var c3=0x80+(charCode&0x003f); +arrs[offset+i-startIdx]=String.fromCharCode(c1)+String.fromCharCode(c2)+String.fromCharCode(c3); +} +} +return arrs.join(''); +}; +Encoding.base64Chars=new Array( +'A','B','C','D','E','F','G','H', +'I','J','K','L','M','N','O','P', +'Q','R','S','T','U','V','W','X', +'Y','Z','a','b','c','d','e','f', +'g','h','i','j','k','l','m','n', +'o','p','q','r','s','t','u','v', +'w','x','y','z','0','1','2','3', +'4','5','6','7','8','9','+','/' +); +Encoding.encodeBase64=function(str){ +if(str==null||str.length==0)return str; +var b64=Encoding.base64Chars; +var length=str.length; +var index=0; +var buf=[]; +var c0,c1,c2; +while(index>2]; +if(index>4)]; +if(index>6)]; +buf[buf.length]=b64[c2&0x3F]; +}else{ +buf[buf.length]=b64[((c1<<2)&0x3c)]; +buf[buf.length]='='; +} +}else{ +buf[buf.length]=b64[(c0<<4)&0x30]; +buf[buf.length]='='; +buf[buf.length]='='; +} +} +return buf.join(''); +}; +Encoding.decodeBase64=function(str){ +if(str==null||str.length==0)return str; +var b64=Encoding.base64Chars; +var xb64=Encoding.xBase64Chars; +if(Encoding.xBase64Chars==null){ +xb64=new Object(); +for(var i=0;i>4); +if(c2!=null){ +buf[buf.length]=String.fromCharCode(((c1<<4)&0xff)|c2>>2); +if(c3!=null){ +buf[buf.length]=String.fromCharCode(((c2<<6)&0xff)|c3); +} +} +} +return buf.join(''); +}; + +if(String.prototype.$replace==null){ +java.lang.String=String; +if(Clazz._supportsNativeObject){ +for(var i=0;i= 0) c1 = "\\" + c1; + } else { + c1=c1.replace(/([\\\$\.\*\+\|\?\^\{\}\(\)\[\]])/g,function($0,$1){return"\\"+$1;}); + } + return this.replace(new RegExp(c1,"gm"),c2); +}; +sp.$generateExpFunction=function(str){ +var arr=[]; +var orders=[]; +var idx=0; +arr[0]=""; +var i=0; +for(;ithis.length-len)|| +(ooffset>other.length-len)){ +return false; +} +var s1=this.substring(toffset,toffset+len); +var s2=other.substring(ooffset,ooffset+len); +if(ignoreCase){ +s1=s1.toLowerCase(); +s2=s2.toLowerCase(); +} +return s1==s2; +}; + + + +sp.$plit=function(regex,limit){ +if (!limit && regex == " ") + return this.split(regex); + +if(limit!=null&&limit>0){ +if(limit==1){ +return this; +} +var regExp=new RegExp("("+regex+")","gm"); +var count=1; +var s=this.replace(regExp,function($0,$1){ +count++; +if(count==limit){ +return"@@_@@"; +}else if(count>limit){ +return $0; +}else{ +return $0; +} +}); +regExp=new RegExp(regex,"gm"); +var arr=this.split(regExp); +if(arr.length>limit){ +arr[limit-1]=s.substring(s.indexOf("@@_@@")+5); +arr.length=limit; +} +return arr; +}else{ +var regExp=new RegExp(regex,"gm"); +return this.split(regExp); +} +}; +/* +sp.trim=function(){ +var len=this.length; +var st=0; + +while((st0)||(lens.length-pc)){ +return false; +} +while(--pc>=0){ +if(s.charAt(to++)!=prefix.charAt(po++)){ +return false; +} +} +return true; +}; + +sp.startsWith=function(prefix){ +if(arguments.length==1){ +return sn(this,arguments[0],0); +}else if(arguments.length==2){ +return sn(this,arguments[0],arguments[1]); +}else{ +return false; +} +}; + +sp.endsWith=function(suffix){ +return sn(this, suffix,this.length-suffix.length); +}; + +} + +sp.equals=function(anObject){ +return this.valueOf()==anObject; +}; + +sp.equalsIgnoreCase=function(anotherString){ +return(anotherString==null)?false:(this==anotherString +||this.toLowerCase()==anotherString.toLowerCase()); +}; + + +sp.hash=0; + +sp.hashCode=function(){ +var h=this.hash; +if(h==0){ +var off=0; +var len=this.length; +for(var i=0;i255){ +arrs[ii]=0x1a; +arrs[ii+1]=c&0xff; +arrs[ii+2]=(c&0xff00)>>8; +ii+=2; +}else{ +arrs[ii]=c; +} +ii++; +} +return arrs; +}; + +/* +sp.compareTo=function(anotherString){ +if(anotherString==null){ +throw new java.lang.NullPointerException(); +} +var len1=this.length; +var len2=anotherString.length; +var n=Math.min(len1,len2); +var k=0; +while(k= 0} // bh added +sp.compareTo = function(a){return this > a ? 1 : this < a ? -1 : 0} // bh added + + + +sp.toCharArray=function(){ +var result=new Array(this.length); +for(var i=0;is2){ +return 1; +}else{ +return-1; +} +} +}; + +sp.contentEquals=function(sb){ +if(this.length!=sb.length()){ +return false; +} +var v=sb.getValue(); +var i=0; +var j=0; +var n=this.length; +while(n--!=0){ +if(this.charCodeAt(i++)!=v[j++]){ +return false; +} +} +return true; +}; + +sp.getChars=function(srcBegin,srcEnd,dst,dstBegin){ +if(srcBegin<0){ +throw new StringIndexOutOfBoundsException(srcBegin); +} +if(srcEnd>this.length){ +throw new StringIndexOutOfBoundsException(srcEnd); +} +if(srcBegin>srcEnd){ +throw new StringIndexOutOfBoundsException(srcEnd-srcBegin); +} +if(dst==null){ +throw new NullPointerException(); +} +for(var i=0;i=sourceCount){ +return(targetCount==0?sourceCount:-1); +} +if(fromIndex<0){ +fromIndex=0; +} +if(targetCount==0){ +return fromIndex; +} + +var first=target[targetOffset]; +var i=sourceOffset+fromIndex; +var max=sourceOffset+(sourceCount-targetCount); + +startSearchForFirstChar: +while(true){ + +while(i<=max&&source[i]!=first){ +i++; +} +if(i>max){ +return-1; +} + + +var j=i+1; +var end=j+targetCount-1; +var k=targetOffset+1; +while(j0&&typeof x[0]=="number"){ +var arr=new Array(x.length); +for(var i=0;ibytes.length){ +throw new IndexOutOfBoundsException(); +} +if(length>0){ +var isChar=(bytes[offset].length!=null); +if(isChar){ +for(var i=0;i0;){ +value[i]=String.fromCharCode(bytes[i+offset]&0xff); +} +}else{ +hibyte<<=8; +for(var i=count;i-->0;){ +value[i]=String.fromCharCode(hibyte|(bytes[i+offset]&0xff)); +} +} +return value.join(''); +} +}else{ +var s=""; +for(var i=0;ibytes.length){ + throw new IndexOutOfBoundsException(); + } + if(length>0){ + var isChar=(bytes[offset].length!=null); + if(isChar){ + for(var i=0;i0;){ + value[i]=String.fromCharCode(bytes[i+offset]&0xff); + } + }else{ + hibyte<<=8; + for(var i=count;i-->0;){ + value[i]=String.fromCharCode(hibyte|(bytes[i+offset]&0xff)); + } + } + return value.join(''); +default: + var s=""; + for(var i=0;i= 0x1c && c <= 0x20 || c >= 0x9 && c <= 0xd || c == 0x1680 + || c >= 0x2000 && c != 0x2007 && (c <= 0x200b || c == 0x2028 || c == 0x2029 || c == 0x3000)); +},"~N"); +c$.isLetter=Clazz_defineMethod(c$,"isLetter", +function(c){ +c = c.charCodeAt(0); +return (65 <= c && c <= 90 || 97 <= c && c <= 122); +},"~N"); +c$.isLetterOrDigit=Clazz_defineMethod(c$,"isLetterOrDigit", +function(c){ +c = c.charCodeAt(0); +return (65 <= c && c <= 90 || 97 <= c && c <= 122 || 48 <= c && c <= 57); +},"~N"); +c$.isSpaceChar=Clazz_defineMethod(c$,"isSpaceChar", +function(c){ + var i = c.charCodeAt(0); +if(i==0x20||i==0xa0||i==0x1680)return true; +if(i<0x2000)return false; +return i<=0x200b||i==0x2028||i==0x2029||i==0x202f||i==0x3000; +},"~N"); +c$.digit=Clazz_defineMethod(c$,"digit", +function(c,radix){ +var i = c.charCodeAt(0); +if(radix >= 2 && radix <= 36){ + if(i < 128){ + var result = -1; + if(48 <= i && i <= 57){ + result = i - 48; + }else if(97 <= i && i <= 122){ + result = i - 87; + }else if(65 <= i && i <= 90){ + result=i-(55); + } + return (result < radix ? result : -1); + } +} +return -1; +},"~N,~N"); +Clazz_overrideMethod(c$,"toString", +function(){ +var buf=[this.value]; +return String.valueOf(buf); +}); +c$.toString=Clazz_overrideMethod(c$,"toString", +function(c){ +{ +if(this===Character){ +return"class java.lang.Character"; +} +}return String.valueOf(c); +},"~N"); +Clazz_defineStatics(c$, +"MIN_VALUE",'\u0000', +"MAX_VALUE",'\uffff', +"MIN_RADIX",2, +"MAX_RADIX",36, +"TYPE",null); + +java.lang.Character.TYPE=java.lang.Character.prototype.TYPE=java.lang.Character; + + + +Clazz._ArrayWrapper = function(a, type) { + return { + a: a, + __CLASS_NAME__:"Array", + superClazz: Array, + getComponentType: function() {return type}, + instanceOf: function(o) { return Clazz_instanceOf(type, o) }, + getName: function() { return this.__CLASS_NAME__ } + }; +} +c$=Clazz_declareType(java.lang.reflect,"Array"); +c$.newInstance=Clazz_defineMethod(c$,"newInstance", +function(componentType,size){ +var a = Clazz_newArray(size); + a.getClass = function() { return new Clazz._ArrayWrapper(this, componentType);}; +return a; +},"Class,~N"); + +javautil.Date=Date; +Date.TYPE="javautil.Date"; +Date.__CLASS_NAME__="Date"; +Clazz_implementOf(Date,[java.io.Serializable,java.lang.Comparable]); + +Clazz_defineMethod(javautil.Date,"clone", +function(){ +return new Date(this.getTime()); +}); + +Clazz_defineMethod(javautil.Date,"before", +function(when){ +return this.getTime()when.getTime(); +},"javautil.Date"); +Clazz_defineMethod(javautil.Date,"equals", +function(obj){ +return Clazz_instanceOf(obj,javautil.Date)&&this.getTime()==(obj).getTime(); +},"Object"); +Clazz_defineMethod(javautil.Date,"compareTo", +function(anotherDate){ +var thisTime=this.getTime(); +var anotherTime=anotherDate.getTime(); +return(thisTime>32)); +}); + +c$=Clazz_decorateAsClass(function(){ +this.source=null; +Clazz_instantialize(this,arguments); +},javautil,"EventObject",null,java.io.Serializable); +Clazz_makeConstructor(c$, +function(source){ +if(source!=null)this.source=source; +else throw new IllegalArgumentException(); +},"~O"); +Clazz_defineMethod(c$,"getSource", +function(){ +return this.source; +}); +Clazz_overrideMethod(c$,"toString", +function(){ +return this.getClass().getName()+"[source="+String.valueOf(this.source)+']'; +}); +Clazz_declareInterface(javautil,"EventListener"); + +c$=Clazz_decorateAsClass(function(){ +this.listener=null; +Clazz_instantialize(this,arguments); +},javautil,"EventListenerProxy",null,javautil.EventListener); +Clazz_makeConstructor(c$, +function(listener){ +this.listener=listener; +},"javautil.EventListener"); +Clazz_defineMethod(c$,"getListener", +function(){ +return this.listener; +}); +Clazz_declareInterface(javautil,"Iterator"); + +Clazz_declareInterface(javautil,"ListIterator",javautil.Iterator); +Clazz_declareInterface(javautil,"Enumeration"); +Clazz_declareInterface(javautil,"Collection",Iterable); + +Clazz_declareInterface(javautil,"Set",javautil.Collection); +Clazz_declareInterface(javautil,"Map"); +Clazz_declareInterface(javautil.Map,"Entry"); + +Clazz_declareInterface(javautil,"List",javautil.Collection); + +Clazz_declareInterface(javautil,"Queue",javautil.Collection); +Clazz_declareInterface(javautil,"RandomAccess"); +c$=Clazz_decorateAsClass(function(){ +this.detailMessage=null; +this.cause=null; +this.stackTrace=null; +Clazz_instantialize(this,arguments); +},java.lang,"Throwable",null,java.io.Serializable); +Clazz_prepareFields(c$,function(){ +this.cause=this; +//alert("e0 "+ arguments.callee.caller.caller.caller.caller.caller) +}); +Clazz_makeConstructor(c$, +function(){ +this.fillInStackTrace(); +}); +Clazz_makeConstructor(c$, +function(message){ +this.fillInStackTrace(); +this.detailMessage=message; +},"~S"); +Clazz_makeConstructor(c$, +function(message,cause){ +this.fillInStackTrace(); +this.detailMessage=message; +this.cause=cause; +},"~S,Throwable"); +Clazz_makeConstructor(c$, +function(cause){ +this.fillInStackTrace(); +this.detailMessage=(cause==null?null:cause.toString()); +this.cause=cause; +},"Throwable"); +Clazz_defineMethod(c$,"getMessage", +function(){ +return (this.message || this.detailMessage || this.toString()); +}); +Clazz_defineMethod(c$,"getLocalizedMessage", +function(){ +return this.getMessage(); +}); +Clazz_defineMethod(c$,"getCause", +function(){ +return(this.cause===this?null:this.cause); +}); +Clazz_defineMethod(c$,"initCause", +function(cause){ +if(this.cause!==this)throw new IllegalStateException("Can't overwrite cause"); +if(cause===this)throw new IllegalArgumentException("Self-causation not permitted"); +this.cause=cause; +return this; +},"Throwable"); +Clazz_overrideMethod(c$,"toString", +function(){ +var s=this.getClass().getName(); +var message=this.message || this.detailMessage; +return(message ? s+": "+message : s); +}); +Clazz_defineMethod(c$,"printStackTrace", +function(){ +System.err.println(this.getStackTrace ? this.getStackTrace() : this.message + " " + Clazz_getStackTrace()); +}); + +Clazz_defineMethod(c$,"getStackTrace", +function(){ +var s = "" + this + "\n"; +for(var i=0;i-1||caller!=null){ +var clazzName=null; +var nativeClass=null; +if(!noLooping||caller==Clazz_tryToSearchAndExecute||caller==Clazz_superCall||caller==null){ +if(index<0){ +break; +} +noLooping=true; +superCaller=Clazz._callingStackTraces[index].caller; +nativeClass=Clazz._callingStackTraces[index].owner; +index--; +}else{ +superCaller=caller; +if(superCaller.claxxOwner!=null){ +nativeClass=superCaller.claxxOwner; +}else if(superCaller.exClazz!=null){ +nativeClass=superCaller.exClazz; +} +} +var st=new StackTraceElement( +((nativeClass!=null&&nativeClass.__CLASS_NAME__.length!=0)? +nativeClass.__CLASS_NAME__:"anonymous"), +((superCaller.exName==null)?"anonymous":superCaller.exName) ++" ("+Clazz_getParamsType(superCaller.arguments)+")", +null,-1); +st.nativeClazz=nativeClass; +this.stackTrace[this.stackTrace.length]=st; +for(var i=0;i":this.declaringClass; +}); +Clazz_defineMethod(c$,"getFileName", +function(){ +return this.fileName; +}); +Clazz_defineMethod(c$,"getLineNumber", +function(){ +return this.lineNumber; +}); +Clazz_defineMethod(c$,"getMethodName", +function(){ +return(this.methodName==null)?"":this.methodName; +}); +Clazz_overrideMethod(c$,"hashCode", +function(){ +if(this.methodName==null){ +return 0; +}return this.methodName.hashCode()^this.declaringClass.hashCode(); +}); +Clazz_defineMethod(c$,"isNativeMethod", +function(){ +return this.lineNumber==-2; +}); +Clazz_overrideMethod(c$,"toString", +function(){ +var buf=new StringBuilder(80); +buf.append(this.getClassName()); +buf.append('.'); +buf.append(this.getMethodName()); +if(this.isNativeMethod()){ +buf.append("(Native Method)"); +}else{ +var fName=this.getFileName(); +if(fName==null){ +buf.append("(Unknown Source)"); +}else{ +var lineNum=this.getLineNumber(); +buf.append('('); +buf.append(fName); +if(lineNum>=0){ +buf.append(':'); +buf.append(lineNum); +}buf.append(')'); +}}return buf.toString(); +}); +TypeError.prototype.getMessage || (TypeError.prototype.getMessage = function(){ return (this.message || this.toString()) + (this.getStackTrace ? this.getStackTrace() : Clazz_getStackTrace())}); +c$=Clazz_declareType(java.lang,"Error",Throwable); + +c$=Clazz_declareType(java.lang,"LinkageError",Error); + +c$=Clazz_declareType(java.lang,"IncompatibleClassChangeError",LinkageError); + +c$=Clazz_declareType(java.lang,"AbstractMethodError",IncompatibleClassChangeError); + +c$=Clazz_declareType(java.lang,"AssertionError",Error); +Clazz_makeConstructor(c$, +function(detailMessage){ +Clazz_superConstructor(this,AssertionError,[String.valueOf(detailMessage),(Clazz_instanceOf(detailMessage,Throwable)?detailMessage:null)]); +},"~O"); +Clazz_makeConstructor(c$, +function(detailMessage){ +this.construct("" + detailMessage); +},"~B"); +Clazz_makeConstructor(c$, +function(detailMessage){ +this.construct("" + detailMessage); +},"~N"); + +c$=Clazz_declareType(java.lang,"ClassCircularityError",LinkageError); + +c$=Clazz_declareType(java.lang,"ClassFormatError",LinkageError); + +c$=Clazz_decorateAsClass(function(){ +this.exception=null; +Clazz_instantialize(this,arguments); +},java.lang,"ExceptionInInitializerError",LinkageError); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,ExceptionInInitializerError); +this.initCause(null); +}); +Clazz_makeConstructor(c$, +function(detailMessage){ +Clazz_superConstructor(this,ExceptionInInitializerError,[detailMessage]); +this.initCause(null); +},"~S"); +Clazz_makeConstructor(c$, +function(exception){ +Clazz_superConstructor(this,ExceptionInInitializerError); +this.exception=exception; +this.initCause(exception); +},"Throwable"); +Clazz_defineMethod(c$,"getException", +function(){ +return this.exception; +}); +Clazz_overrideMethod(c$,"getCause", +function(){ +return this.exception; +}); + +c$=Clazz_declareType(java.lang,"IllegalAccessError",IncompatibleClassChangeError); + +c$=Clazz_declareType(java.lang,"InstantiationError",IncompatibleClassChangeError); + +c$=Clazz_declareType(java.lang,"VirtualMachineError",Error); + +c$=Clazz_declareType(java.lang,"InternalError",VirtualMachineError); + +c$=Clazz_declareType(java.lang,"NoClassDefFoundError",LinkageError); + +c$=Clazz_declareType(java.lang,"NoSuchFieldError",IncompatibleClassChangeError); + +c$=Clazz_declareType(java.lang,"NoSuchMethodError",IncompatibleClassChangeError); + +c$=Clazz_declareType(java.lang,"OutOfMemoryError",VirtualMachineError); + +c$=Clazz_declareType(java.lang,"StackOverflowError",VirtualMachineError); + +c$=Clazz_declareType(java.lang,"UnknownError",VirtualMachineError); + +c$=Clazz_declareType(java.lang,"UnsatisfiedLinkError",LinkageError); + +c$=Clazz_declareType(java.lang,"UnsupportedClassVersionError",ClassFormatError); + +c$=Clazz_declareType(java.lang,"VerifyError",LinkageError); + +c$=Clazz_declareType(java.lang,"ThreadDeath",Error); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,ThreadDeath,[]); +}); + +c$=Clazz_declareType(java.lang,"Exception",Throwable); + +c$=Clazz_declareType(java.lang,"RuntimeException",Exception); + +c$=Clazz_declareType(java.lang,"ArithmeticException",RuntimeException); + +c$=Clazz_declareType(java.lang,"IndexOutOfBoundsException",RuntimeException); + +c$=Clazz_declareType(java.lang,"ArrayIndexOutOfBoundsException",IndexOutOfBoundsException); +Clazz_makeConstructor(c$, +function(index){ +Clazz_superConstructor(this,ArrayIndexOutOfBoundsException,["Array index out of range: "+index]); +},"~N"); + +c$=Clazz_declareType(java.lang,"ArrayStoreException",RuntimeException); + +c$=Clazz_declareType(java.lang,"ClassCastException",RuntimeException); + +c$=Clazz_decorateAsClass(function(){ +this.ex=null; +Clazz_instantialize(this,arguments); +},java.lang,"ClassNotFoundException",Exception); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,ClassNotFoundException,[Clazz_castNullAs("Throwable")]); +}); +Clazz_makeConstructor(c$, +function(detailMessage){ +Clazz_superConstructor(this,ClassNotFoundException,[detailMessage,null]); +},"~S"); +Clazz_makeConstructor(c$, +function(detailMessage,exception){ +Clazz_superConstructor(this,ClassNotFoundException,[detailMessage]); +this.ex=exception; +},"~S,Throwable"); +Clazz_defineMethod(c$,"getException", +function(){ +return this.ex; +}); +Clazz_overrideMethod(c$,"getCause", +function(){ +return this.ex; +}); + +c$=Clazz_declareType(java.lang,"CloneNotSupportedException",Exception); + +c$=Clazz_declareType(java.lang,"IllegalAccessException",Exception); + +c$=Clazz_declareType(java.lang,"IllegalArgumentException",RuntimeException); +Clazz_makeConstructor(c$, +function(cause){ +Clazz_superConstructor(this,IllegalArgumentException,[(cause==null?null:cause.toString()),cause]); +},"Throwable"); + +c$=Clazz_declareType(java.lang,"IllegalMonitorStateException",RuntimeException); + +c$=Clazz_declareType(java.lang,"IllegalStateException",RuntimeException); +Clazz_makeConstructor(c$, +function(cause){ +Clazz_superConstructor(this,IllegalStateException,[(cause==null?null:cause.toString()),cause]); +},"Throwable"); + +c$=Clazz_declareType(java.lang,"IllegalThreadStateException",IllegalArgumentException); + +c$=Clazz_declareType(java.lang,"InstantiationException",Exception); + +c$=Clazz_declareType(java.lang,"InterruptedException",Exception); + +c$=Clazz_declareType(java.lang,"NegativeArraySizeException",RuntimeException); + +c$=Clazz_declareType(java.lang,"NoSuchFieldException",Exception); + +c$=Clazz_declareType(java.lang,"NoSuchMethodException",Exception); + +c$=Clazz_declareType(java.lang,"NullPointerException",RuntimeException); + +c$=Clazz_declareType(java.lang,"NumberFormatException",IllegalArgumentException); + +c$=Clazz_declareType(java.lang,"SecurityException",RuntimeException); +Clazz_makeConstructor(c$, +function(cause){ +Clazz_superConstructor(this,SecurityException,[(cause==null?null:cause.toString()),cause]); +},"Throwable"); + +c$=Clazz_declareType(java.lang,"StringIndexOutOfBoundsException",IndexOutOfBoundsException); +Clazz_makeConstructor(c$, +function(index){ +Clazz_superConstructor(this,StringIndexOutOfBoundsException,["String index out of range: "+index]); +},"~N"); + +c$=Clazz_declareType(java.lang,"UnsupportedOperationException",RuntimeException); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,UnsupportedOperationException,[]); +}); +Clazz_makeConstructor(c$, +function(cause){ +Clazz_superConstructor(this,UnsupportedOperationException,[(cause==null?null:cause.toString()),cause]); +},"Throwable"); + +c$=Clazz_decorateAsClass(function(){ +this.target=null; +Clazz_instantialize(this,arguments); +},java.lang.reflect,"InvocationTargetException",Exception); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[Clazz_castNullAs("Throwable")]); +}); +Clazz_makeConstructor(c$, +function(exception){ +Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[null,exception]); +this.target=exception; +},"Throwable"); +Clazz_makeConstructor(c$, +function(exception,detailMessage){ +Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[detailMessage,exception]); +this.target=exception; +},"Throwable,~S"); +Clazz_defineMethod(c$,"getTargetException", +function(){ +return this.target; +}); +Clazz_overrideMethod(c$,"getCause", +function(){ +return this.target; +}); + +c$=Clazz_decorateAsClass(function(){ +this.undeclaredThrowable=null; +Clazz_instantialize(this,arguments); +},java.lang.reflect,"UndeclaredThrowableException",RuntimeException); +Clazz_makeConstructor(c$, +function(exception){ +Clazz_superConstructor(this,java.lang.reflect.UndeclaredThrowableException); +this.undeclaredThrowable=exception; +this.initCause(exception); +},"Throwable"); +Clazz_makeConstructor(c$, +function(exception,detailMessage){ +Clazz_superConstructor(this,java.lang.reflect.UndeclaredThrowableException,[detailMessage]); +this.undeclaredThrowable=exception; +this.initCause(exception); +},"Throwable,~S"); +Clazz_defineMethod(c$,"getUndeclaredThrowable", +function(){ +return this.undeclaredThrowable; +}); +Clazz_overrideMethod(c$,"getCause", +function(){ +return this.undeclaredThrowable; +}); + +c$=Clazz_declareType(java.io,"IOException",Exception); + + +c$=Clazz_declareType(java.io,"CharConversionException",java.io.IOException); + +c$=Clazz_declareType(java.io,"EOFException",java.io.IOException); + +c$=Clazz_declareType(java.io,"FileNotFoundException",java.io.IOException); + +c$=Clazz_decorateAsClass(function(){ +this.bytesTransferred=0; +Clazz_instantialize(this,arguments); +},java.io,"InterruptedIOException",java.io.IOException); + +c$=Clazz_declareType(java.io,"ObjectStreamException",java.io.IOException); + +c$=Clazz_decorateAsClass(function(){ +this.classname=null; +Clazz_instantialize(this,arguments); +},java.io,"InvalidClassException",java.io.ObjectStreamException); +Clazz_makeConstructor(c$, +function(className,detailMessage){ +Clazz_superConstructor(this,java.io.InvalidClassException,[detailMessage]); +this.classname=className; +},"~S,~S"); +Clazz_defineMethod(c$,"getMessage", +function(){ +var msg=Clazz_superCall(this,java.io.InvalidClassException,"getMessage",[]); +if(this.classname!=null){ +msg=this.classname+';' + ' '+msg; +}return msg; +}); + +c$=Clazz_declareType(java.io,"InvalidObjectException",java.io.ObjectStreamException); + +c$=Clazz_declareType(java.io,"NotActiveException",java.io.ObjectStreamException); + +c$=Clazz_declareType(java.io,"NotSerializableException",java.io.ObjectStreamException); + +c$=Clazz_decorateAsClass(function(){ +this.eof=false; +this.length=0; +Clazz_instantialize(this,arguments); +},java.io,"OptionalDataException",java.io.ObjectStreamException); + +c$=Clazz_declareType(java.io,"StreamCorruptedException",java.io.ObjectStreamException); + +c$=Clazz_declareType(java.io,"SyncFailedException",java.io.IOException); + +c$=Clazz_declareType(java.io,"UnsupportedEncodingException",java.io.IOException); + +c$=Clazz_declareType(java.io,"UTFDataFormatException",java.io.IOException); + +c$=Clazz_decorateAsClass(function(){ +this.detail=null; +Clazz_instantialize(this,arguments); +},java.io,"WriteAbortedException",java.io.ObjectStreamException); +Clazz_makeConstructor(c$, +function(detailMessage,rootCause){ +Clazz_superConstructor(this,java.io.WriteAbortedException,[detailMessage]); +this.detail=rootCause; +this.initCause(rootCause); +},"~S,Exception"); +Clazz_defineMethod(c$,"getMessage", +function(){ +var msg=Clazz_superCall(this,java.io.WriteAbortedException,"getMessage",[]); +return (this.detail ? msg + "; "+this.detail.toString() : msg); +}); +Clazz_overrideMethod(c$,"getCause", +function(){ +return this.detail; +}); + +c$=Clazz_declareType(javautil,"ConcurrentModificationException",RuntimeException); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,javautil.ConcurrentModificationException,[]); +}); + +c$=Clazz_declareType(javautil,"EmptyStackException",RuntimeException); + +c$=Clazz_decorateAsClass(function(){ +this.className=null; +this.key=null; +Clazz_instantialize(this,arguments); +},javautil,"MissingResourceException",RuntimeException); +Clazz_makeConstructor(c$, +function(detailMessage,className,resourceName){ +Clazz_superConstructor(this,javautil.MissingResourceException,[detailMessage]); +this.className=className; +this.key=resourceName; +},"~S,~S,~S"); +Clazz_defineMethod(c$,"getClassName", +function(){ +return this.className; +}); +Clazz_defineMethod(c$,"getKey", +function(){ +return this.key; +}); + +c$=Clazz_declareType(javautil,"NoSuchElementException",RuntimeException); + +c$=Clazz_declareType(javautil,"TooManyListenersException",Exception); + +c$=Clazz_declareType(java.lang,"Void"); +Clazz_defineStatics(c$, +"TYPE",null); +{ +java.lang.Void.TYPE=java.lang.Void; +}Clazz_declareInterface(java.lang.reflect,"GenericDeclaration"); +Clazz_declareInterface(java.lang.reflect,"AnnotatedElement"); + +c$=Clazz_declareType(java.lang.reflect,"AccessibleObject",null,java.lang.reflect.AnnotatedElement); +Clazz_makeConstructor(c$, +function(){ +}); +Clazz_defineMethod(c$,"isAccessible", +function(){ +return false; +}); +c$.setAccessible=Clazz_defineMethod(c$,"setAccessible", +function(objects,flag){ +return; +},"~A,~B"); +Clazz_defineMethod(c$,"setAccessible", +function(flag){ +return; +},"~B"); +Clazz_overrideMethod(c$,"isAnnotationPresent", +function(annotationType){ +return false; +},"Class"); +Clazz_overrideMethod(c$,"getDeclaredAnnotations", +function(){ +return new Array(0); +}); +Clazz_overrideMethod(c$,"getAnnotations", +function(){ +return new Array(0); +}); +Clazz_overrideMethod(c$,"getAnnotation", +function(annotationType){ +return null; +},"Class"); +c$.marshallArguments=Clazz_defineMethod(c$,"marshallArguments", +function(parameterTypes,args){ +return null; +},"~A,~A"); +Clazz_defineMethod(c$,"invokeV", +function(receiver,args){ +return; +},"~O,~A"); +Clazz_defineMethod(c$,"invokeL", +function(receiver,args){ +return null; +},"~O,~A"); +Clazz_defineMethod(c$,"invokeI", +function(receiver,args){ +return 0; +},"~O,~A"); +Clazz_defineMethod(c$,"invokeJ", +function(receiver,args){ +return 0; +},"~O,~A"); +Clazz_defineMethod(c$,"invokeF", +function(receiver,args){ +return 0.0; +},"~O,~A"); +Clazz_defineMethod(c$,"invokeD", +function(receiver,args){ +return 0.0; +},"~O,~A"); +c$.emptyArgs=c$.prototype.emptyArgs=new Array(0); +Clazz_declareInterface(java.lang.reflect,"InvocationHandler"); +c$=Clazz_declareInterface(java.lang.reflect,"Member"); +Clazz_defineStatics(c$, +"PUBLIC",0, +"DECLARED",1); + +c$=Clazz_declareType(java.lang.reflect,"Modifier"); +Clazz_makeConstructor(c$, +function(){ +}); +c$.isAbstract=Clazz_defineMethod(c$,"isAbstract", +function(modifiers){ +return((modifiers&1024)!=0); +},"~N"); +c$.isFinal=Clazz_defineMethod(c$,"isFinal", +function(modifiers){ +return((modifiers&16)!=0); +},"~N"); +c$.isInterface=Clazz_defineMethod(c$,"isInterface", +function(modifiers){ +return((modifiers&512)!=0); +},"~N"); +c$.isNative=Clazz_defineMethod(c$,"isNative", +function(modifiers){ +return((modifiers&256)!=0); +},"~N"); +c$.isPrivate=Clazz_defineMethod(c$,"isPrivate", +function(modifiers){ +return((modifiers&2)!=0); +},"~N"); +c$.isProtected=Clazz_defineMethod(c$,"isProtected", +function(modifiers){ +return((modifiers&4)!=0); +},"~N"); +c$.isPublic=Clazz_defineMethod(c$,"isPublic", +function(modifiers){ +return((modifiers&1)!=0); +},"~N"); +c$.isStatic=Clazz_defineMethod(c$,"isStatic", +function(modifiers){ +return((modifiers&8)!=0); +},"~N"); +c$.isStrict=Clazz_defineMethod(c$,"isStrict", +function(modifiers){ +return((modifiers&2048)!=0); +},"~N"); +c$.isSynchronized=Clazz_defineMethod(c$,"isSynchronized", +function(modifiers){ +return((modifiers&32)!=0); +},"~N"); +c$.isTransient=Clazz_defineMethod(c$,"isTransient", +function(modifiers){ +return((modifiers&128)!=0); +},"~N"); +c$.isVolatile=Clazz_defineMethod(c$,"isVolatile", +function(modifiers){ +return((modifiers&64)!=0); +},"~N"); +c$.toString=Clazz_defineMethod(c$,"toString", +function(modifiers){ +var sb=new Array(0); +if(java.lang.reflect.Modifier.isPublic(modifiers))sb[sb.length]="public"; +if(java.lang.reflect.Modifier.isProtected(modifiers))sb[sb.length]="protected"; +if(java.lang.reflect.Modifier.isPrivate(modifiers))sb[sb.length]="private"; +if(java.lang.reflect.Modifier.isAbstract(modifiers))sb[sb.length]="abstract"; +if(java.lang.reflect.Modifier.isStatic(modifiers))sb[sb.length]="static"; +if(java.lang.reflect.Modifier.isFinal(modifiers))sb[sb.length]="final"; +if(java.lang.reflect.Modifier.isTransient(modifiers))sb[sb.length]="transient"; +if(java.lang.reflect.Modifier.isVolatile(modifiers))sb[sb.length]="volatile"; +if(java.lang.reflect.Modifier.isSynchronized(modifiers))sb[sb.length]="synchronized"; +if(java.lang.reflect.Modifier.isNative(modifiers))sb[sb.length]="native"; +if(java.lang.reflect.Modifier.isStrict(modifiers))sb[sb.length]="strictfp"; +if(java.lang.reflect.Modifier.isInterface(modifiers))sb[sb.length]="interface"; +if(sb.length>0){ +return sb.join(" "); +}return""; +},"~N"); +Clazz_defineStatics(c$, +"PUBLIC",0x1, +"PRIVATE",0x2, +"PROTECTED",0x4, +"STATIC",0x8, +"FINAL",0x10, +"SYNCHRONIZED",0x20, +"VOLATILE",0x40, +"TRANSIENT",0x80, +"NATIVE",0x100, +"INTERFACE",0x200, +"ABSTRACT",0x400, +"STRICT",0x800, +"BRIDGE",0x40, +"VARARGS",0x80, +"SYNTHETIC",0x1000, +"ANNOTATION",0x2000, +"ENUM",0x4000); + +c$=Clazz_decorateAsClass(function(){ +this.clazz=null; +this.parameterTypes=null; +this.exceptionTypes=null; +this.modifiers=0; +Clazz_instantialize(this,arguments); +},java.lang.reflect,"Constructor",java.lang.reflect.AccessibleObject,[java.lang.reflect.GenericDeclaration,java.lang.reflect.Member]); +Clazz_makeConstructor(c$, +function(declaringClass,parameterTypes,checkedExceptions,modifiers){ +Clazz_superConstructor(this,java.lang.reflect.Constructor,[]); +this.clazz=declaringClass; +this.parameterTypes=parameterTypes; +this.exceptionTypes=checkedExceptions; +this.modifiers=modifiers; +},"Class,~A,~A,~N"); +Clazz_overrideMethod(c$,"getTypeParameters", +function(){ +return null; +}); +Clazz_defineMethod(c$,"toGenericString", +function(){ +return null; +}); +Clazz_defineMethod(c$,"getGenericParameterTypes", +function(){ +return null; +}); +Clazz_defineMethod(c$,"getGenericExceptionTypes", +function(){ +return null; +}); +Clazz_defineMethod(c$,"getParameterAnnotations", +function(){ +return null; +}); +Clazz_defineMethod(c$,"isVarArgs", +function(){ +return false; +}); +Clazz_overrideMethod(c$,"isSynthetic", +function(){ +return false; +}); +Clazz_overrideMethod(c$,"equals", +function(object){ +if(object!=null&&Clazz_instanceOf(object,java.lang.reflect.Constructor)){ +var other=object; +if(this.getDeclaringClass()===other.getDeclaringClass()){ +var params1=this.parameterTypes; +var params2=other.parameterTypes; +if(params1.length==params2.length){ +for(var i=0;i