1 |
/* Float.java -- object wrapper for float |
/* Float.java -- object wrapper for float |
2 |
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 |
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 |
3 |
Free Software Foundation, Inc. |
Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
52 |
* @since 1.0 |
* @since 1.0 |
53 |
* @status updated to 1.4 |
* @status updated to 1.4 |
54 |
*/ |
*/ |
55 |
public final class Float extends Number implements Comparable |
public final class Float extends Number implements Comparable<Float> |
56 |
{ |
{ |
57 |
/** |
/** |
58 |
* Compatible with JDK 1.0+. |
* Compatible with JDK 1.0+. |
91 |
* <code>Class</code> object. |
* <code>Class</code> object. |
92 |
* @since 1.1 |
* @since 1.1 |
93 |
*/ |
*/ |
94 |
public static final Class TYPE = VMClassLoader.getPrimitiveClass('F'); |
public static final Class<Float> TYPE = VMClassLoader.getPrimitiveClass('F'); |
95 |
|
|
96 |
|
/** |
97 |
|
* The number of bits needed to represent a <code>float</code>. |
98 |
|
* @since 1.5 |
99 |
|
*/ |
100 |
|
public static final int SIZE = 32; |
101 |
|
|
102 |
/** |
/** |
103 |
* The immutable value of this Float. |
* The immutable value of this Float. |
198 |
} |
} |
199 |
|
|
200 |
/** |
/** |
201 |
|
* Returns a <code>Float</code> object wrapping the value. |
202 |
|
* In contrast to the <code>Float</code> constructor, this method |
203 |
|
* may cache some values. It is used by boxing conversion. |
204 |
|
* |
205 |
|
* @param val the value to wrap |
206 |
|
* @return the <code>Float</code> |
207 |
|
*/ |
208 |
|
public static Float valueOf(float val) |
209 |
|
{ |
210 |
|
// We don't actually cache, but we could. |
211 |
|
return new Float(val); |
212 |
|
} |
213 |
|
|
214 |
|
/** |
215 |
* Parse the specified <code>String</code> as a <code>float</code>. The |
* Parse the specified <code>String</code> as a <code>float</code>. The |
216 |
* extended BNF grammar is as follows:<br> |
* extended BNF grammar is as follows:<br> |
217 |
* <pre> |
* <pre> |