Package totalcross.util
Class Properties.Double
- java.lang.Object
-
- totalcross.util.Properties.Value
-
- totalcross.util.Properties.Double
-
- Enclosing class:
- Properties
public static class Properties.Double extends Properties.Value
Implements a value of type double
-
-
Field Summary
Fields Modifier and Type Field Description static charTYPEdoublevalue-
Fields inherited from class totalcross.util.Properties.Value
type, typeStr
-
-
Constructor Summary
Constructors Constructor Description Double(double value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Compares this object against the specified object.inthashCode()Returns a hash code for thisDoubleobject.java.lang.StringtoString()
-
-
-
Field Detail
-
TYPE
public static final char TYPE
- See Also:
- Constant Field Values
-
value
public double value
-
-
Method Detail
-
toString
public java.lang.String toString()
- Specified by:
toStringin classProperties.Value
-
hashCode
public int hashCode()
Returns a hash code for thisDoubleobject. The result is the exclusive OR of the two halves of thelonginteger bit representation, exactly as produced by the methoddoubleToLongBits(double), of the primitivedoublevalue represented by thisDoubleobject. That is, the hash code is the value of the expression:
where(int) (v ˆ (v >>> 32))
vis defined by:long v = Convert.doubleToLongBits(this.value);
- Overrides:
hashCodein classjava.lang.Object- Since:
- TotalCross 1.25
-
equals
public boolean equals(java.lang.Object obj)
Compares this object against the specified object. The result istrueif and only if the argument is notnulland is aDoubleobject that represents adoublethat has the same value as thedoublerepresented by this object. For this purpose, twodoublevalues are considered to be the same if and only if the methoddoubleToLongBits(double)returns the identicallongvalue when applied to each.Note that in most cases, for two instances of class
Double,d1andd2, the value ofd1.equals(d2)istrueif and only ifConvert.doubleToLongBits(d1.value) == Convert.doubleToLongBits(d2.value)
also has the value
true. However, there are two exceptions:- If
d1andd2both representConvert.DOUBLE_NAN_BITS, then theequalsmethod returnstrue, even thoughConvert.doubleToLongBits(Convert.DOUBLE_NAN_BITS) == Convert.doubleToLongBits(Convert.DOUBLE_NAN_BITS)has the valuefalse. - If
d1represents+0.0whiled2represents-0.0, or vice versa, theequaltest has the valuefalse, even though+0.0==-0.0has the valuetrue.
- Overrides:
equalsin classjava.lang.Object- Since:
- TotalCross 1.25
- If
-
-