| |
|
| java.lang.Object java.lang.Number java.lang.Float
Field Summary | |
final public static float | MAX_VALUE
Constant for the maximum float value, (2 - 2-23) *
2127. | final public static float | MIN_VALUE
Constant for the minimum float value, 2-149. | final public static float | NEGATIVE_INFINITY
Constant for the Negative Infinity value of the float
type. | final public static float | NaN
Constant for the Not-a-Number (NaN) value of the float
type. | final public static float | POSITIVE_INFINITY
Constant for the Positive Infinity value of the float
type. | final public static int | SIZE
Constant for the number of bits to represent a float in
two's compliment form. | final public static Class<Float> | TYPE The java.lang.Class that represents this class. |
Constructor Summary | |
public | Float(float value) Constructs a new instance of the receiver which represents the float
valued argument. | public | Float(double value) Constructs a new instance of the receiver which represents the double
valued argument. | public | Float(String string) Constructs a new instance of this class given a string. |
Method Summary | |
public byte | byteValue() | public static int | compare(float float1, float float2) Compares the two floats. | public int | compareTo(Float object) Compares the receiver with the Float parameter. | public double | doubleValue() | public boolean | equals(Object object) Compares the argument to the receiver, and answers true if they represent
the same object using a class specific comparison. | native public static int | floatToIntBits(float value) Answers the binary representation of the argument, as an int. | native public static int | floatToRawIntBits(float value) Answers the binary representation of the argument, as an int. | public float | floatValue() Answers the receiver's value as a float. | public int | hashCode() Answers an integer hash code for the receiver. | native public static float | intBitsToFloat(int bits) Answers a float built from the binary representation given in the
argument. | public int | intValue() | public boolean | isInfinite() Answers true if the receiver represents an infinite quantity, and false
otherwise. | public static boolean | isInfinite(float f) Answers true if the argument represents an infinite quantity, and false
otherwise.
Parameters: f - value to check for infinitness. | public boolean | isNaN() Answers true if the receiver does not represent a valid float quantity. | public static boolean | isNaN(float f) Answers true if the argument does not represent a valid float quantity.
Parameters: f - value to check for numberness. | public long | longValue() | public static float | parseFloat(String string) Answers the float which matches the passed in string. | public short | shortValue() | public static String | toHexString(float f)
Converts a float into a hexadecimal string representation.
Parameters: f - The float to convert. | public String | toString() Answers a string containing a concise, human-readable description of the
receiver. | public static String | toString(float f) Answers a string containing a printable representation of the argument. | public static Float | valueOf(String string) Answers the float which matches the passed in string. | public static Float | valueOf(float f)
Returns a Float instance for the float
value passed. |
MAX_VALUE | final public static float MAX_VALUE(Code) | |
Constant for the maximum float value, (2 - 2-23) *
2127.
|
MIN_VALUE | final public static float MIN_VALUE(Code) | |
Constant for the minimum float value, 2-149.
|
NEGATIVE_INFINITY | final public static float NEGATIVE_INFINITY(Code) | |
Constant for the Negative Infinity value of the float
type.
|
NaN | final public static float NaN(Code) | |
Constant for the Not-a-Number (NaN) value of the float
type.
|
POSITIVE_INFINITY | final public static float POSITIVE_INFINITY(Code) | |
Constant for the Positive Infinity value of the float
type.
|
SIZE | final public static int SIZE(Code) | |
Constant for the number of bits to represent a float in
two's compliment form.
since: 1.5 |
TYPE | final public static Class<Float> TYPE(Code) | | The java.lang.Class that represents this class.
since: 1.1 |
Float | public Float(float value)(Code) | | Constructs a new instance of the receiver which represents the float
valued argument.
Parameters: value - the float to store in the new instance. |
Float | public Float(double value)(Code) | | Constructs a new instance of the receiver which represents the double
valued argument.
Parameters: value - the double to store in the new instance. |
Float | public Float(String string) throws NumberFormatException(Code) | | Constructs a new instance of this class given a string.
Parameters: string - a string representation of a float quantity. exception: NumberFormatException - if the argument could not be parsed as a float quantity. |
byteValue | public byte byteValue()(Code) | | Answers the byte value which the receiver represents
byte the value of the receiver. |
compare | public static int compare(float float1, float float2)(Code) | | Compares the two floats. NaN is equal to NaN, and is greater than other
float values. 0f is greater than -0f.
Parameters: float1 - the first value to compare Parameters: float2 - the second value to compare Returns greater than zero when float1 is greater than float2,zero when float1 equals float2, and less than zero when float1 isless than float2 since: 1.4 |
compareTo | public int compareTo(Float object)(Code) | | Compares the receiver with the Float parameter. NaN is equal to NaN, and
is greater than other float values. 0f is greater than -0f.
Parameters: object - the Float to compare to the receiver Returns greater than zero when this.floatValue() is greater thanobject.floatValue(), zero when this.floatValue() equalsobject.floatValue(), and less than zero when this.floatValue() isless than object.floatValue() throws: NullPointerException - if object is null . since: 1.2 |
doubleValue | public double doubleValue()(Code) | | Answers the double value which the receiver represents
double the value of the receiver. |
equals | public boolean equals(Object object)(Code) | | Compares the argument to the receiver, and answers true if they represent
the same object using a class specific comparison. For Floats,
the check verifies that the receiver's value's bit pattern matches the
bit pattern of the argument, which must also be a Float.
Parameters: object - the object to compare with this object true if the object is the same as this objectfalse if it is different from this object See Also: Float.hashCode |
floatToIntBits | native public static int floatToIntBits(float value)(Code) | | Answers the binary representation of the argument, as an int.
Parameters: value - The float value to convert the bits of the float. |
floatToRawIntBits | native public static int floatToRawIntBits(float value)(Code) | | Answers the binary representation of the argument, as an int.
Parameters: value - The float value to convert the bits of the float. |
floatValue | public float floatValue()(Code) | | Answers the receiver's value as a float.
the receiver's value |
hashCode | public int hashCode()(Code) | | Answers an integer hash code for the receiver. Any two objects which
answer true when passed to equals must
answer the same value for this method.
the receiver's hash See Also: Float.equals |
intBitsToFloat | native public static float intBitsToFloat(int bits)(Code) | | Answers a float built from the binary representation given in the
argument.
Parameters: bits - the bits of the float the float which matches the bits |
intValue | public int intValue()(Code) | | Answers the int value which the receiver represents
int the value of the receiver. |
isInfinite | public boolean isInfinite()(Code) | | Answers true if the receiver represents an infinite quantity, and false
otherwise.
true if the argument is positive or negativeinfinity false if it is not an infinite value |
isInfinite | public static boolean isInfinite(float f)(Code) | | Answers true if the argument represents an infinite quantity, and false
otherwise.
Parameters: f - value to check for infinitness. true if the argument is positive or negativeinfinity false if it is not an infinite value |
isNaN | public boolean isNaN()(Code) | | Answers true if the receiver does not represent a valid float quantity.
true if the argument is Not A Numberfalse if it is a (potentially infinite) floatnumber |
isNaN | public static boolean isNaN(float f)(Code) | | Answers true if the argument does not represent a valid float quantity.
Parameters: f - value to check for numberness. true if the argument is Not A Numberfalse if it is a (potentially infinite) floatnumber |
longValue | public long longValue()(Code) | | Answers the long value which the receiver represents
long the value of the receiver. |
parseFloat | public static float parseFloat(String string) throws NumberFormatException(Code) | | Answers the float which matches the passed in string.
NumberFormatException is thrown if the string does not represent a valid
float.
Parameters: string - the value to convert a float which would print as the argument See Also: Float.valueOf(String) since: 1.2 |
shortValue | public short shortValue()(Code) | | Answers the short value which the receiver represents
short the value of the receiver. since: 1.1 |
toHexString | public static String toHexString(float f)(Code) | |
Converts a float into a hexadecimal string representation.
Parameters: f - The float to convert. The hexadecimal string representation of f . since: 1.5 |
toString | public String toString()(Code) | | Answers a string containing a concise, human-readable description of the
receiver.
a printable representation for the receiver. |
toString | public static String toString(float f)(Code) | | Answers a string containing a printable representation of the argument.
Parameters: f - the float to print a printable representation of the argument. |
valueOf | public static Float valueOf(String string) throws NumberFormatException(Code) | | Answers the float which matches the passed in string.
NumberFormatException is thrown if the string does not represent a valid
float.
Parameters: string - the value to convert a float which would print as the argument |
valueOf | public static Float valueOf(float f)(Code) | |
Returns a Float instance for the float
value passed. This method is preferred over the constructor, as this
method may maintain a cache of instances.
Parameters: f - The float value. A Float instance. since: 1.5 |
|
|
|