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/Float.java | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'libjava/java/lang/Float.java') diff --git a/libjava/java/lang/Float.java b/libjava/java/lang/Float.java index b2c84c75655..7677ca4132e 100644 --- a/libjava/java/lang/Float.java +++ b/libjava/java/lang/Float.java @@ -1,5 +1,5 @@ /* Float.java -- object wrapper for float - 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. @@ -93,6 +93,12 @@ public final class Float extends Number implements Comparable */ public static final Class TYPE = VMClassLoader.getPrimitiveClass('F'); + /** + * The number of bits needed to represent a float. + * @since 1.5 + */ + public static final int SIZE = 32; + /** * The immutable value of this Float. * @@ -191,6 +197,22 @@ public final class Float extends Number implements Comparable return new Float(parseFloat(s)); } + /** + * Returns a Float object wrapping the value. + * In contrast to the Float constructor, this method + * may cache some values. It is used by boxing conversion. + * + * @param val the value to wrap + * @return the Float + * + * @since 1.5 + */ + public static Float valueOf(float val) + { + // We don't actually cache, but we could. + return new Float(val); + } + /** * Parse the specified String as a float. The * extended BNF grammar is as follows:
-- cgit v1.2.3