Save This Page
Home » apache-harmony-6.0-src-r917296-snapshot » java » lang » [javadoc | source]
java.lang
public final class: Float [javadoc | source]
java.lang.Object
   java.lang.Number
      java.lang.Float

All Implemented Interfaces:
    Comparable, Serializable

The wrapper for the primitive type {@code float}.
Field Summary
public static final  float MAX_VALUE    Constant for the maximum {@code float} value, (2 - 2-23) * 2127
public static final  float MIN_VALUE    Constant for the minimum {@code float} value, 2-149
public static final  float MIN_NORMAL   

Constant for the smallest positive normal value of float.

    since: 1.6 -
 
public static final  float NaN    Constant for the Not-a-Number (NaN) value of the {@code float} type. 
public static final  float POSITIVE_INFINITY    Constant for the Positive Infinity value of the {@code float} type. 
public static final  float NEGATIVE_INFINITY    Constant for the Negative Infinity value of the {@code float} type. 
public static final  Class<Float> TYPE    The Class object that represents the primitive type {@code float}.
    since: 1.1 -
 
public static final  int MAX_EXPONENT   

Maximum exponent that a finite float variable may have.

    since: 1.6 -
 
public static final  int MIN_EXPONENT   

Minimum exponent that a finite float variable may have.

    since: 1.6 -
 
public static final  int SIZE    Constant for the number of bits needed to represent a {@code float} in two's complement form.
    since: 1.5 -
 
Constructor:
 public Float(float value) 
 public Float(double value) 
 public Float(String string) throws NumberFormatException 
    Constructs a new {@code Float} from the specified string.
    Parameters:
    string - the string representation of a float value.
    Throws:
    NumberFormatException - if {@code string} can not be decoded into a float value.
    Also see:
    parseFloat(String)
Method from java.lang.Float Summary:
byteValue,   compare,   compareTo,   doubleValue,   equals,   floatToIntBits,   floatToRawIntBits,   floatValue,   hashCode,   intBitsToFloat,   intValue,   isInfinite,   isInfinite,   isNaN,   isNaN,   longValue,   parseFloat,   shortValue,   toHexString,   toString,   toString,   valueOf,   valueOf
Methods from java.lang.Number:
byteValue,   doubleValue,   floatValue,   intValue,   longValue,   shortValue
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.lang.Float Detail:
 public byte byteValue() 
 public static int compare(float float1,
    float float2) 
    Compares the two specified float values. There are two special cases:
    • {@code Float.NaN} is equal to {@code Float.NaN} and it is greater than any other float value, including {@code Float.POSITIVE_INFINITY};
    • +0.0f is greater than -0.0f
 public int compareTo(Float object) 
    Compares this object to the specified float object to determine their relative order. There are two special cases:
    • {@code Float.NaN} is equal to {@code Float.NaN} and it is greater than any other float value, including {@code Float.POSITIVE_INFINITY};
    • +0.0f is greater than -0.0f
 public double doubleValue() 
 public boolean equals(Object object) 
    Compares this instance with the specified object and indicates if they are equal. In order to be equal, {@code object} must be an instance of {@code Float} and have the same float value as this object.
 public static native int floatToIntBits(float value)
    Converts the specified float value to a binary representation conforming to the IEEE 754 floating-point single precision bit layout. All Not-a-Number (NaN) values are converted to a single NaN representation ({@code 0x7ff8000000000000L}).
 public static native int floatToRawIntBits(float value)
    Converts the specified float value to a binary representation conforming to the IEEE 754 floating-point single precision bit layout. Not-a-Number (NaN) values are preserved.
 public float floatValue() 
    Gets the primitive value of this float.
 public int hashCode() 
 public static native float intBitsToFloat(int bits)
    Converts the specified IEEE 754 floating-point single precision bit pattern to a Java float value.
 public int intValue() 
 public boolean isInfinite() 
    Indicates whether this object represents an infinite value.
 public static boolean isInfinite(float f) 
    Indicates whether the specified float represents an infinite value.
 public boolean isNaN() 
    Indicates whether this object is a Not-a-Number (NaN) value.
 public static boolean isNaN(float f) 
    Indicates whether the specified float is a Not-a-Number (NaN) value.
 public long longValue() 
 public static float parseFloat(String string) throws NumberFormatException 
    Parses the specified string as a float value.
 public short shortValue() 
 public static String toHexString(float f) 
    Converts the specified float into its hexadecimal string representation.
 public String toString() 
 public static String toString(float f) 
    Returns a string containing a concise, human-readable description of the specified float value.
 public static Float valueOf(String string) throws NumberFormatException 
    Parses the specified string as a float value.
 public static Float valueOf(float f) 
    Returns a {@code Float} instance for the specified float value.