1 Clazz.load (["java.lang.Comparable", "$.Number"], "java.lang.Double", null, function () {
2 java.lang.Double = Double = function () {
3 Clazz.instantialize (this, arguments);
5 Clazz.decorateAsType (Double, "Double", Number, Comparable, null, true);
6 Double.prototype.valueOf = function () { return 0; };
7 Double.toString = Double.prototype.toString = function () {
8 if (arguments.length != 0) {
9 return "" + arguments[0];
10 } else if (this === Double) {
11 return "class java.lang.Double"; // Double.class.toString
13 return "" + this.valueOf ();
15 Clazz.makeConstructor (Double,
17 this.valueOf = function () {
21 Clazz.makeConstructor (Double,
23 this.valueOf = function () {
27 Clazz.makeConstructor (Double,
29 var value = Double.parseDouble (s);
30 this.valueOf = function () {
35 Double.serialVersionUID = Double.prototype.serialVersionUID = -9172774392245257468;
36 Double.MIN_VALUE = Double.prototype.MIN_VALUE = 4.9e-324;
37 Double.MAX_VALUE = Double.prototype.MAX_VALUE = 1.7976931348623157e+308;
38 Double.NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
39 Double.POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
40 Double.NaN = Number.NaN;
41 Double.TYPE = Double.prototype.TYPE = Double;
43 Clazz.defineMethod (Double, "isNaN",
47 Double.isNaN = Double.prototype.isNaN;
48 Clazz.defineMethod (Double, "isInfinite",
50 return !isFinite (num);
52 Double.isInfinite = Double.prototype.isInfinite;
54 Clazz.defineMethod (Double, "parseDouble",
57 throw new NumberFormatException ("null");
59 var doubleVal = parseFloat (s);
61 throw new NumberFormatException ("Not a Number : " + s);
65 Double.parseDouble = Double.prototype.parseDouble;
67 Clazz.defineMethod (Double, "$valueOf",
69 return new Double(this.parseDouble(s));
72 Clazz.defineMethod (Double, "$valueOf",
77 Double.$valueOf = Double.prototype.$valueOf;
79 Clazz.overrideMethod(Double, "equals",
81 if(s == null || ! Clazz.instanceOf(s, Double) ){
84 return s.valueOf() == this.valueOf();