From a79cb46cf43218d467e93cc62430bcad41cafc12 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 9 Jan 2006 06:42:19 +0000 Subject: StringBuilder.java (appendCodePoint): New method. * 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. From-SVN: r109497 --- libjava/java/lang/Double.java | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'libjava/java/lang/Double.java') 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 Double represent primitive @@ -88,6 +87,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 double. + * @since 1.5 + */ + public static final int SIZE = 64; + /** * The primitive type double is represented by this * Class object. @@ -102,18 +107,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 Double from the primitive double * specified. @@ -179,6 +172,22 @@ public final class Double extends Number implements Comparable return toString(d, false); } + /** + * Returns a Double object wrapping the value. + * In contrast to the Double constructor, this method + * may cache some values. It is used by boxing conversion. + * + * @param val the value to wrap + * @return the Double + * + * @since 1.5 + */ + public static Double valueOf(double val) + { + // We don't actually cache, but we could. + return new Double(val); + } + /** * Create a new Double object using the String. * @@ -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(); } -- cgit v1.2.3