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/Float.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/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 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. @@ -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> |
