diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-09 06:42:19 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-09 06:42:19 +0000 |
commit | de4bd8a5b113924bd46c78a981292f918191928a (patch) | |
tree | 8d8125b902675158f355742846d7cbefd59dcdae /libjava/java/lang/Double.java | |
parent | 62479b5aadf80f84365f7d305fcd1ae7da1a73d5 (diff) | |
download | gcc-de4bd8a5b113924bd46c78a981292f918191928a.tar.gz |
* java/lang/StringBuilder.java (appendCodePoint): New method.
(insert): New overloads.
* java/lang/StringBuffer.java (StringBuffer): New constructor.
(charAt): Remerged javadoc.
(codePointAt, codePointBefore): New methods.
(appendCodePoint): New method.
(append): New overloads.
(insert): Likewise.
(trimToSize, codePointCount, offsetByCodePoints): New methods.
* java/lang/Float.java (SIZE): New field.
(valueOf): New method.
* java/lang/natDouble.cc (initIDs): Removed.
* java/lang/Double.java (static initializer): Removed.
(SIZE): New field.
(valueOf): New method.
(initIDs): Removed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109497 138bc75d-0d04-0410-961f-82ee72b054a4
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(); } |