|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Number
java.lang.Double
public final class Double
Double provides a class for double values stored in objects.
| Field Summary | |
|---|---|
static int |
MAX_EXPONENT
The maximum value the exponent may have. |
static double |
MAX_VALUE
The largest value a double can hold. |
static int |
MIN_EXPONENT
The minimum value the exponent may have. |
static double |
MIN_NORMAL
The smallest positive value that can be represented by a normalized double. |
static double |
MIN_VALUE
The smallest value a double can hold. |
static double |
NaN
Numerical constant: NaN |
static double |
NEGATIVE_INFINITY
Numerical constant: -Infinity |
static double |
POSITIVE_INFINITY
Numerical constant: +Infinity |
static int |
SIZE
The size occupied by one double in bits. |
static Class<Double> |
TYPE
type for double. |
| Constructor Summary | |
|---|---|
Double(double value)
Constructor to create an instance of Double with the given double value. |
|
Double(String s)
Constructor to create an instance of Double with the value provided as a string. |
|
| Method Summary | |
|---|---|
byte |
byteValue()
byteValue returns the value of this as a byte. |
static int |
compare(double v1,
double v2)
compare compares two double values |
int |
compareTo(Double anotherDouble)
compareTo compares this to another Double value. |
static long |
doubleToLongBits(double value)
doubleToLongBits returns the integer representation of a double value. |
static long |
doubleToRawLongBits(double value)
doubleToRawLongBits returns the raw integer representation of a double value. |
double |
doubleValue()
doubleValue returns the value of this as a double. |
boolean |
equals(Object obj)
equals tests if 2 double instances are equal. |
float |
floatValue()
floatValue returns the value of this as a float. |
int |
hashCode()
hashCode determines a hashCode for this Double instance. |
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(double v)
isInfinite checks if the double value is Infinity or -Infinity. |
boolean |
isNaN()
isNaN checks if this instance represents a NaN |
static boolean |
isNaN(double v)
isNaN checks if the double value is a NaN. |
static double |
longBitsToDouble(long bits)
longBitsToDouble creates a double value with the given integer representation. |
long |
longValue()
longValue returns the value of this as a long. |
static double |
parseDouble(String doubleString)
parseDouble parses a double value given as a string. |
short |
shortValue()
shortValue returns the value of this as a short. |
static String |
toHexString(double d)
Convert this double 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(doubleValue()). |
static String |
toString(double v)
toString converts a given double value to a string. |
static Double |
valueOf(double d)
valueOf returns a Double instance with the given value. |
static Double |
valueOf(String s)
valueOf creates an instance of Double 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 double POSITIVE_INFINITY
public static final double NEGATIVE_INFINITY
public static final double NaN
public static final double MIN_VALUE
public static final double MAX_VALUE
public static final double MIN_NORMAL
public static final int MAX_EXPONENT
public static final int MIN_EXPONENT
public static final int SIZE
public static final Class<Double> TYPE
| Constructor Detail |
|---|
public Double(double value)
value - the value for this instance.
public Double(String s)
throws NumberFormatException
s - the string representation of the value.
NumberFormatException - if s could not be parsed as a double.| Method Detail |
|---|
public static String toString(double v)
v - the double value.
public static String toHexString(double d)
d - a double
public static Double valueOf(String s)
throws NumberFormatException
s - the string representation of the value.
NumberFormatException - if s could not be parsed as a double.public static Double valueOf(double d)
d - the double value
public static double parseDouble(String doubleString)
doubleString - the string represenation.
overflow.
public static boolean isNaN(double v)
v - the double value.
public static boolean isInfinite(double v)
v - the double 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
doubleToLongBits(((Double) obj).doubleValue()).
public static long doubleToLongBits(double value)
value - the double value.
public static long doubleToRawLongBits(double value)
value - the double value.
public static double longBitsToDouble(long bits)
bits - the integer representation.
public int compareTo(Double anotherDouble)
compareTo in interface Comparable<Double>anotherDouble - the other double
larger than o.
public static int compare(double v1,
double v2)
v1 - the first double valuev2 - the second double value
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||