|
Build 1.0_r1(from source) | |||||||||
| 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 is the wrapper for the primitive type float.
Number,
Serialized Form| Field Summary | |
|---|---|
static float |
MAX_VALUE
Constant for the maximum float value, (2 - 2-23) *
2127. |
static float |
MIN_VALUE
Constant for the minimum float value, 2-149. |
static float |
NaN
Constant for the Not-a-Number (NaN) value of the float
type. |
static float |
NEGATIVE_INFINITY
Constant for the Negative Infinity value of the float
type. |
static float |
POSITIVE_INFINITY
Constant for the Positive Infinity value of the float
type. |
static int |
SIZE
Constant for the number of bits to represent a float in
two's compliment form. |
static Class<Float> |
TYPE
The java.lang.Class that represents this class. |
| Constructor Summary | |
|---|---|
Float(double value)
Constructs a new instance of the receiver which represents the double valued argument. |
|
Float(float value)
Constructs a new instance of the receiver which represents the float valued argument. |
|
Float(String string)
Constructs a new instance of this class given a string. |
|
| Method Summary | |
|---|---|
byte |
byteValue()
Returns the byte value which the receiver represents |
static int |
compare(float float1,
float float2)
Compares the two floats. |
int |
compareTo(Float object)
Compares the receiver with the Float parameter. |
double |
doubleValue()
Returns the double value which the receiver represents |
boolean |
equals(Object object)
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. |
static int |
floatToIntBits(float value)
Returns the binary representation of the argument, as an int. |
static int |
floatToRawIntBits(float value)
Returns the binary representation of the argument, as an int. |
float |
floatValue()
Returns the receiver's value as a float. |
int |
hashCode()
Returns an integer hash code for the receiver. |
static float |
intBitsToFloat(int bits)
Returns a float built from the binary representation given in the argument. |
int |
intValue()
Returns the int value which the receiver represents |
boolean |
isInfinite()
Returns true if the receiver represents an infinite quantity, and false otherwise. |
static boolean |
isInfinite(float f)
Returns true if the argument represents an infinite quantity, and false otherwise. |
boolean |
isNaN()
Returns true if the receiver does not represent a valid float quantity. |
static boolean |
isNaN(float f)
Returns true if the argument does not represent a valid float quantity. |
long |
longValue()
Returns the long value which the receiver represents |
static float |
parseFloat(String string)
Returns the float which matches the passed in string. |
short |
shortValue()
Returns the short value which the receiver represents |
static String |
toHexString(float f)
Converts a float into a hexadecimal string representation. |
String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
static String |
toString(float f)
Returns a string containing a printable representation of the argument. |
static Float |
valueOf(float f)
Returns a Float instance for the float
value passed. |
static Float |
valueOf(String string)
Returns the float which matches the passed in string. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final float MAX_VALUE
Constant for the maximum float value, (2 - 2-23) *
2127.
public static final float MIN_VALUE
Constant for the minimum float value, 2-149.
public static final float NaN
Constant for the Not-a-Number (NaN) value of the float
type.
public static final float POSITIVE_INFINITY
Constant for the Positive Infinity value of the float
type.
public static final float NEGATIVE_INFINITY
Constant for the Negative Infinity value of the float
type.
public static final Class<Float> TYPE
public static final int SIZE
Constant for the number of bits to represent a float in
two's compliment form.
| Constructor Detail |
|---|
public Float(float value)
value - the float to store in the new instance.public Float(double value)
value - the double to store in the new instance.
public Float(String string)
throws NumberFormatException
string - a string representation of a float quantity.
NumberFormatException - if the argument could not be parsed as a float quantity.| Method Detail |
|---|
public int compareTo(Float object)
compareTo in interface Comparable<Float>object - the Float to compare to the receiver
NullPointerException - if object is null.public byte byteValue()
byteValue in class Numberpublic double doubleValue()
doubleValue in class Numberpublic boolean equals(Object object)
equals in class Objectobject - the object to compare with this object
true if the object is the same as this object
false if it is different from this objecthashCode()public static int floatToIntBits(float value)
value - The float value to convert
public static int floatToRawIntBits(float value)
value - The float value to convert
public float floatValue()
floatValue in class Numberpublic int hashCode()
true when passed to equals must
answer the same value for this method.
hashCode in class Objectequals(java.lang.Object)public static float intBitsToFloat(int bits)
bits - the bits of the float
public int intValue()
intValue in class Numberpublic boolean isInfinite()
true if the argument is positive or negative
infinity false if it is not an infinite valuepublic static boolean isInfinite(float f)
f - value to check for infinitness.
true if the argument is positive or negative
infinity false if it is not an infinite valuepublic boolean isNaN()
true if the argument is Not A Number
false if it is a (potentially infinite) float
numberpublic static boolean isNaN(float f)
f - value to check for numberness.
true if the argument is Not A Number
false if it is a (potentially infinite) float
numberpublic long longValue()
longValue in class Number
public static float parseFloat(String string)
throws NumberFormatException
string - the value to convert
NumberFormatExceptionvalueOf(String)public short shortValue()
shortValue in class Numberpublic String toString()
toString in class Objectpublic static String toString(float f)
f - the float to print
public static Float valueOf(String string)
throws NumberFormatException
string - the value to convert
NumberFormatException
public static int compare(float float1,
float float2)
float1 - the first value to comparefloat2 - the second value to compare
public static Float valueOf(float f)
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.
f - The float value.
Float instance.public static String toHexString(float f)
Converts a float into a hexadecimal string representation.
f - The float to convert.
f.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||