java.lang.Object | ||
↳ | java.lang.Number | |
↳ | java.lang.Double |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
double | MAX_VALUE | Constant for the maximum double value, (2 - 2-52) *
21023. |
|||||||||
double | MIN_VALUE | Constant for the minimum double value, 2-1074. |
|||||||||
double | NEGATIVE_INFINITY | Constant for the Negative Infinity value of the double type. |
|||||||||
double | NaN | Constant for the Not-a-Number (NaN) value of the double type. |
|||||||||
double | POSITIVE_INFINITY | Constant for the Positive Infinity value of the double type. |
|||||||||
int | SIZE | Constant for the number of bits needed to represent a double in
two's complement form. |
|||||||||
Class<Double> | TYPE | The Class object that represents the primitive type double . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
Double with the specified primitive double
value. | |||||||||||
Constructs a new
Double from the specified string. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns this object's value as a byte.
| |||||||||||
Compares the two specified double values.
| |||||||||||
Compares this object to the specified double object to determine their
relative order.
| |||||||||||
Converts the specified double value to a binary representation conforming
to the IEEE 754 floating-point double precision bit layout.
| |||||||||||
Converts the specified double value to a binary representation conforming
to the IEEE 754 floating-point double precision bit layout.
| |||||||||||
Gets the primitive value of this double.
| |||||||||||
Compares this object with the specified object and indicates if they are
equal.
| |||||||||||
Returns this object's value as a float.
| |||||||||||
Returns an integer hash code for this object.
| |||||||||||
Returns this object's value as an int.
| |||||||||||
Indicates whether the specified double represents an infinite value.
| |||||||||||
Indicates whether this object represents an infinite value.
| |||||||||||
Indicates whether the specified double is a Not-a-Number (NaN)
value.
| |||||||||||
Indicates whether this object is a Not-a-Number (NaN) value.
| |||||||||||
Converts the specified IEEE 754 floating-point double precision bit
pattern to a Java double value.
| |||||||||||
Returns this object's value as a long.
| |||||||||||
Parses the specified string as a double value.
| |||||||||||
Returns this object's value as a short.
| |||||||||||
Converts the specified double into its hexadecimal string representation.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
| |||||||||||
Returns a string containing a concise, human-readable description of the
specified double value.
| |||||||||||
Parses the specified string as a double value.
| |||||||||||
Returns a
Double instance for the specified double value. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Number
| |||||||||||
From class java.lang.Object
| |||||||||||
From interface java.lang.Comparable
|
Constant for the maximum double
value, (2 - 2-52) *
21023.
Constant for the minimum double
value, 2-1074.
Constant for the Negative Infinity value of the double
type.
Constant for the Not-a-Number (NaN) value of the double
type.
Constant for the Positive Infinity value of the double
type.
Constant for the number of bits needed to represent a double
in
two's complement form.
Constructs a new Double
with the specified primitive double
value.
value | the primitive double value to store in the new instance. |
---|
Constructs a new Double
from the specified string.
string | the string representation of a double value. |
---|
NumberFormatException | if string can not be decoded into a double value. |
---|
Returns this object's value as a byte. Might involve rounding and/or truncating the value, so it fits into a byte.
Compares the two specified double values. There are two special cases:
Double.NaN
is equal to Double.NaN
and it is greater
than any other double value, including Double.POSITIVE_INFINITY
;double1 | the first value to compare. |
---|---|
double2 | the second value to compare. |
double1
is less than double2
;
0 if double1
and double2
are equal; a positive
value if double1
is greater than double2
.Compares this object to the specified double object to determine their relative order. There are two special cases:
Double.NaN
is equal to Double.NaN
and it is greater
than any other double value, including Double.POSITIVE_INFINITY
;object | the double object to compare this object to. |
---|
object
; 0 if the value of this double and the
value of object
are equal; a positive value if the value
of this double is greater than the value of object
.Converts the specified double value to a binary representation conforming
to the IEEE 754 floating-point double precision bit layout. All
Not-a-Number (NaN) values are converted to a single NaN
representation (0x7ff8000000000000L
).
value | the double value to convert. |
---|
value
.Converts the specified double value to a binary representation conforming to the IEEE 754 floating-point double precision bit layout. Not-a-Number (NaN) values are preserved.
value | the double value to convert. |
---|
value
.Gets the primitive value of this double.
Compares this object with the specified object and indicates if they are
equal. In order to be equal, object
must be an instance of
Double
and the bit pattern of its double value is the same as
this object's.
object | the object to compare this double with. |
---|
true
if the specified object is equal to this
Double
; false
otherwise.Returns this object's value as a float. Might involve rounding.
Returns an integer hash code for this object. By contract, any two
objects for which equals(Object)
returns true
must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Returns this object's value as an int. Might involve rounding and/or truncating the value, so it fits into an int.
Indicates whether the specified double represents an infinite value.
d | the double to check. |
---|
true
if the value of d
is positive or negative
infinity; false
otherwise.Indicates whether this object represents an infinite value.
true
if the value of this double is positive or negative
infinity; false
otherwise.Indicates whether the specified double is a Not-a-Number (NaN) value.
d | the double value to check. |
---|
true
if d
is Not-a-Number;
false
if it is a (potentially infinite) double number.Indicates whether this object is a Not-a-Number (NaN) value.
true
if this double is Not-a-Number;
false
if it is a (potentially infinite) double number.Converts the specified IEEE 754 floating-point double precision bit pattern to a Java double value.
bits | the IEEE 754 floating-point double precision representation of a double value. |
---|
bits
.Returns this object's value as a long. Might involve rounding and/or truncating the value, so it fits into a long.
Parses the specified string as a double value.
string | the string representation of a double value. |
---|
string
.NumberFormatException | if string is null , has a length of zero or
can not be parsed as a double value. |
---|
Returns this object's value as a short. Might involve rounding and/or truncating the value, so it fits into a short.
Converts the specified double into its hexadecimal string representation.
d | the double to convert. |
---|
d
.Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation simply concatenates the class name, the '@' sign and a hexadecimal representation of the object's hashCode(), that is, it is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns a string containing a concise, human-readable description of the specified double value.
d | the double to convert to a string. |
---|
d
.Parses the specified string as a double value.
string | the string representation of a double value. |
---|
Double
instance containing the double value represented
by string
.NumberFormatException | if string is null , has a length of zero or
can not be parsed as a double value. |
---|
Returns a Double
instance for the specified double value.
d | the double value to store in the instance. |
---|
Double
instance containing d
.