|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Number
java.lang.Float
public final class Float
Float provides a class for float values stored in objects.
| Field Summary | |
|---|---|
static int |
MAX_EXPONENT
The maximum value the exponent may have. |
static float |
MAX_VALUE
The largest value a float can hold. |
static int |
MIN_EXPONENT
The minimum value the exponent may have. |
static float |
MIN_NORMAL
The smallest positive value that can be represented by a normalized float. |
static float |
MIN_VALUE
The smalles value a float can hold. |
static float |
NaN
Numerical constant: NaN |
static float |
NEGATIVE_INFINITY
Numerical constant: -Infinity |
static float |
POSITIVE_INFINITY
Numerical constant: +Infinity |
static int |
SIZE
The size occupied by one double in bits. |
static Class<Float> |
TYPE
type for float. |
| Constructor Summary | |
|---|---|
Float(double value)
Constructor to create an instance of Float with the given double value converted to float. |
|
Float(float value)
Constructor to create an instance of Float with the given float value. |
|
Float(String s)
Constructor to create an instance of Float with the value provided as a string. |
|
| Method Summary | |
|---|---|
byte |
byteValue()
byteValue returns the value of this as a byte. |
static int |
compare(float v1,
float v2)
compare compares two float values |
int |
compareTo(Float o)
compareTo compares this to another Float value. |
double |
doubleValue()
doubleValue returns the value of this as a double. |
boolean |
equals(Object obj)
equals tests if 2 double instances are equal. |
static int |
floatToIntBits(float value)
floatToIntBits returns the integer representation of a float value. |
static int |
floatToRawIntBits(float value)
floatToRawIntBits returns the raw integer representation of a float value. |
float |
floatValue()
floatValue returns the value of this as a float. |
int |
hashCode()
hashCode determines a hashCode for this Float instance. |
static float |
intBitsToFloat(int bits)
intBitsToFloat creates a float value with the given integer representation. |
int |
intValue()
intValue returns the value of this as an int. |
boolean |
isInfinite()
isInfinite checks if this instance represents Infinity or -Infinity. |
static boolean |
isInfinite(float v)
isInfinite checks if the float value is Infinity or -Infinity. |
boolean |
isNaN()
isNaN checks if this instance represents a NaN |
static boolean |
isNaN(float v)
isNaN checks if the float value is a NaN. |
long |
longValue()
longValue returns the value of this as a long. |
static float |
parseFloat(String floatString)
parseFloat parses a float value given as a string. |
short |
shortValue()
shortValue returns the value of this as a short. |
static String |
toHexString(float f)
Convert this float value to a hex string of the form "0x0.123456p123". |
String |
toString()
toString converts the value of this instance to a string just as toString(floatValue()). |
static String |
toString(float v)
toString converts a given float value to a string. |
static Float |
valueOf(float f)
valueOf returns a Float instance with the given value. |
static Float |
valueOf(String s)
valueOf creates an instance of Float with the value provided as a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final float POSITIVE_INFINITY
public static final float NEGATIVE_INFINITY
public static final float NaN
public static final float MIN_VALUE
public static final float MAX_VALUE
public static final float MIN_NORMAL
public static final int MAX_EXPONENT
public static final int MIN_EXPONENT
public static final int SIZE
public static final Class<Float> TYPE
| Constructor Detail |
|---|
public Float(float value)
value - the value for this instance.public Float(double value)
value - the value for this instance.
public Float(String s)
throws NumberFormatException
s - the string representation of the value.
NumberFormatException - if s could not be parsed as a float.| Method Detail |
|---|
public static String toString(float v)
v - the float value.
public static String toHexString(float f)
f - a float
public static Float valueOf(String s)
throws NumberFormatException
s - the string representation of the value.
NumberFormatException - if s could not be parsed as a float.public static Float valueOf(float f)
f - the float value
public static float parseFloat(String floatString)
throws NumberFormatException
floatString - the string represenation.
overflow.
NumberFormatExceptionpublic static boolean isNaN(float v)
v - the float value.
public static boolean isInfinite(float v)
v - the float value
public boolean isNaN()
public boolean isInfinite()
public String toString()
toString in class Objectpublic byte byteValue()
byteValue in class Numberpublic short shortValue()
shortValue in class Numberpublic int intValue()
intValue in class Numberpublic long longValue()
longValue in class Numberpublic float floatValue()
floatValue in class Numberpublic double doubleValue()
doubleValue in class Numberpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectobj - the other double value
floatToIntToLongBits(((Float) obj).floatValue()).
public static int floatToIntBits(float value)
value - the float value.
public static int floatToRawIntBits(float value)
value - the float value.
public static float intBitsToFloat(int bits)
bits - the integer representation.
public int compareTo(Float o)
compareTo in interface Comparable<Float>o - the other float
larger than o.
public static int compare(float v1,
float v2)
v1 - the first float valuev2 - the second float value
larger than o.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||