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