diff options
Diffstat (limited to 'libjava/java/lang/Double.java')
-rw-r--r-- | libjava/java/lang/Double.java | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/libjava/java/lang/Double.java b/libjava/java/lang/Double.java index f6235d5b65c..92f8a230822 100644 --- a/libjava/java/lang/Double.java +++ b/libjava/java/lang/Double.java @@ -1,5 +1,5 @@ /* Double.java -- object wrapper for double - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,7 +38,6 @@ exception statement from your version. */ package java.lang; -import gnu.classpath.Configuration; /** * Instances of class <code>Double</code> represent primitive @@ -89,6 +88,12 @@ public final class Double extends Number implements Comparable public static final double NaN = 0.0 / 0.0; /** + * The number of bits needed to represent a <code>double</code>. + * @since 1.5 + */ + public static final int SIZE = 64; + + /** * The primitive type <code>double</code> is represented by this * <code>Class</code> object. * @since 1.1 @@ -103,18 +108,6 @@ public final class Double extends Number implements Comparable private final double value; /** - * Load native routines necessary for this class. - */ - static - { - if (Configuration.INIT_LOAD_LIBRARY) - { - System.loadLibrary("javalang"); - initIDs(); - } - } - - /** * Create a <code>Double</code> from the primitive <code>double</code> * specified. * @@ -180,6 +173,22 @@ public final class Double extends Number implements Comparable } /** + * 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> + * + * @since 1.5 + */ + public static Double valueOf(double val) + { + // We don't actually cache, but we could. + return new Double(val); + } + + /** * Create a new <code>Double</code> object using the <code>String</code>. * * @param s the <code>String</code> to convert @@ -534,10 +543,4 @@ public final class Double extends Number implements Comparable */ // 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(); } |