38 |
|
|
39 |
package java.lang; |
package java.lang; |
40 |
|
|
|
import gnu.classpath.Configuration; |
|
41 |
|
|
42 |
/** |
/** |
43 |
* Instances of class <code>Double</code> represent primitive |
* Instances of class <code>Double</code> represent primitive |
90 |
public static final double NaN = 0.0 / 0.0; |
public static final double NaN = 0.0 / 0.0; |
91 |
|
|
92 |
/** |
/** |
93 |
|
* The number of bits needed to represent a <code>double</code>. |
94 |
|
* @since 1.5 |
95 |
|
*/ |
96 |
|
public static final int SIZE = 64; |
97 |
|
|
98 |
|
/** |
99 |
* The primitive type <code>double</code> is represented by this |
* The primitive type <code>double</code> is represented by this |
100 |
* <code>Class</code> object. |
* <code>Class</code> object. |
101 |
* @since 1.1 |
* @since 1.1 |
103 |
public static final Class<Double> TYPE = (Class<Double>) VMClassLoader.getPrimitiveClass('D'); |
public static final Class<Double> TYPE = (Class<Double>) VMClassLoader.getPrimitiveClass('D'); |
104 |
|
|
105 |
/** |
/** |
|
* The number of bits needed to represent a <code>double</code>. |
|
|
* @since 1.5 |
|
|
*/ |
|
|
public static final int SIZE = 64; |
|
|
|
|
|
/** |
|
106 |
* The immutable value of this Double. |
* The immutable value of this Double. |
107 |
* |
* |
108 |
* @serial the wrapped double |
* @serial the wrapped double |
175 |
} |
} |
176 |
|
|
177 |
/** |
/** |
178 |
|
* Returns a <code>Double</code> object wrapping the value. |
179 |
|
* In contrast to the <code>Double</code> constructor, this method |
180 |
|
* may cache some values. It is used by boxing conversion. |
181 |
|
* |
182 |
|
* @param val the value to wrap |
183 |
|
* @return the <code>Double</code> |
184 |
|
* @since 1.5 |
185 |
|
*/ |
186 |
|
public static Double valueOf(double val) |
187 |
|
{ |
188 |
|
// We don't actually cache, but we could. |
189 |
|
return new Double(val); |
190 |
|
} |
191 |
|
|
192 |
|
/** |
193 |
* Create a new <code>Double</code> object using the <code>String</code>. |
* Create a new <code>Double</code> object using the <code>String</code>. |
194 |
* |
* |
195 |
* @param s the <code>String</code> to convert |
* @param s the <code>String</code> to convert |
205 |
} |
} |
206 |
|
|
207 |
/** |
/** |
|
* Returns a <code>Double</code> object wrapping the value. |
|
|
* In contrast to the <code>Double</code> constructor, this method |
|
|
* may cache some values. It is used by boxing conversion. |
|
|
* |
|
|
* @param val the value to wrap |
|
|
* @return the <code>Double</code> |
|
|
*/ |
|
|
public static Double valueOf(double val) |
|
|
{ |
|
|
// We don't actually cache, but we could. |
|
|
return new Double(val); |
|
|
} |
|
|
|
|
|
/** |
|
208 |
* Parse the specified <code>String</code> as a <code>double</code>. The |
* Parse the specified <code>String</code> as a <code>double</code>. The |
209 |
* extended BNF grammar is as follows:<br> |
* extended BNF grammar is as follows:<br> |
210 |
* <pre> |
* <pre> |