public static class Properties.Double extends Properties.Value
Modifier and Type | Field and Description |
---|---|
static char |
TYPE |
double |
value |
type, typeStr
Constructor and Description |
---|
Double(double value) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Compares this object against the specified object.
|
int |
hashCode()
Returns a hash code for this
Double object. |
java.lang.String |
toString() |
public static final char TYPE
public double value
public java.lang.String toString()
toString
in class Properties.Value
public int hashCode()
Double
object. The result is the exclusive OR of the two halves of
the long
integer bit representation, exactly as produced by the method
doubleToLongBits(double)
, of the primitive double
value
represented by this Double
object. That is, the hash code is the value of the expression:
where(int) (v ˆ (v >>> 32))
v
is defined by: long v = Convert.doubleToLongBits(this.value);
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
true
if and only if the argument
is not null
and is a Double
object that represents a double
that has the
same value as the double
represented by this object. For this purpose, two double
values are considered to be the same if and only if the method doubleToLongBits(double)
returns the identical long
value when applied to each.
Note that in most cases, for two instances of class Double
, d1
and d2
,
the value of d1.equals(d2)
is true
if and only if
Convert.doubleToLongBits(d1.value) == Convert.doubleToLongBits(d2.value)
also has the value true
. However, there are two exceptions:
d1
and d2
both represent Convert.DOUBLE_NAN_BITS
, then the
equals
method returns true
, even though
Convert.doubleToLongBits(Convert.DOUBLE_NAN_BITS) == Convert.doubleToLongBits(Convert.DOUBLE_NAN_BITS)
has the value false
.
d1
represents +0.0
while d2
represents -0.0
, or vice
versa, the equal
test has the value false
, even though +0.0==-0.0
has
the value true
.
equals
in class java.lang.Object