103 |
private final double value; |
private final double value; |
104 |
|
|
105 |
/** |
/** |
|
* Load native routines necessary for this class. |
|
|
*/ |
|
|
static |
|
|
{ |
|
|
if (Configuration.INIT_LOAD_LIBRARY) |
|
|
{ |
|
|
System.loadLibrary("javalang"); |
|
|
initIDs(); |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
106 |
* Create a <code>Double</code> from the primitive <code>double</code> |
* Create a <code>Double</code> from the primitive <code>double</code> |
107 |
* specified. |
* specified. |
108 |
* |
* |
164 |
*/ |
*/ |
165 |
public static String toString(double d) |
public static String toString(double d) |
166 |
{ |
{ |
167 |
return toString(d, false); |
return VMDouble.toString(d, false); |
168 |
} |
} |
169 |
|
|
170 |
/** |
/** |
231 |
* @see #NEGATIVE_INFINITY |
* @see #NEGATIVE_INFINITY |
232 |
* @since 1.2 |
* @since 1.2 |
233 |
*/ |
*/ |
234 |
public static native double parseDouble(String str); |
public static double parseDouble(String str) |
235 |
|
{ |
236 |
|
return VMDouble.parseDouble(str); |
237 |
|
} |
238 |
|
|
239 |
/** |
/** |
240 |
* Return <code>true</code> if the <code>double</code> has the same |
* Return <code>true</code> if the <code>double</code> has the same |
518 |
|
|
519 |
return x > y ? 1 : -1; |
return x > y ? 1 : -1; |
520 |
} |
} |
|
|
|
|
/** |
|
|
* Helper method to convert to string. |
|
|
* |
|
|
* @param d the double to convert |
|
|
* @param isFloat true if the conversion is requested by Float (results in |
|
|
* fewer digits) |
|
|
*/ |
|
|
// Package visible for use by Float. |
|
|
static native String toString(double d, boolean isFloat); |
|
|
|
|
|
/** |
|
|
* Initialize JNI cache. This method is called only by the |
|
|
* static initializer when using JNI. |
|
|
*/ |
|
|
private static native void initIDs(); |
|
521 |
} |
} |