diff options
author | Tom Tromey <tromey@redhat.com> | 2006-01-09 06:42:19 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2006-01-09 06:42:19 +0000 |
commit | a79cb46cf43218d467e93cc62430bcad41cafc12 (patch) | |
tree | 8d8125b902675158f355742846d7cbefd59dcdae /libjava/java/lang/Float.java | |
parent | 5109f57e371ed55701b035a86bada3b5c8ef6418 (diff) | |
download | gcc-a79cb46cf43218d467e93cc62430bcad41cafc12.zip gcc-a79cb46cf43218d467e93cc62430bcad41cafc12.tar.gz gcc-a79cb46cf43218d467e93cc62430bcad41cafc12.tar.bz2 |
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
Diffstat (limited to 'libjava/java/lang/Float.java')
-rw-r--r-- | libjava/java/lang/Float.java | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/libjava/java/lang/Float.java b/libjava/java/lang/Float.java index b2c84c7..7677ca4 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. @@ -94,6 +94,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 <code>float</code>. + * @since 1.5 + */ + public static final int SIZE = 32; + + /** * The immutable value of this Float. * * @serial the wrapped float @@ -192,6 +198,22 @@ public final class Float extends Number implements Comparable } /** + * Returns a <code>Float</code> object wrapping the value. + * In contrast to the <code>Float</code> constructor, this method + * may cache some values. It is used by boxing conversion. + * + * @param val the value to wrap + * @return the <code>Float</code> + * + * @since 1.5 + */ + public static Float valueOf(float val) + { + // We don't actually cache, but we could. + return new Float(val); + } + + /** * Parse the specified <code>String</code> as a <code>float</code>. The * extended BNF grammar is as follows:<br> * <pre> |