Class Properties.Double

    • Constructor Summary

      Constructors 
      Constructor Description
      Double​(double value)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Double

        public Double​(double value)
    • Method Detail

      • hashCode

        public int hashCode()
        Returns a hash code for this 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:
         (int) (v ˆ (v >>> 32))
         
        where v is defined by:
         long v = Convert.doubleToLongBits(this.value);
         
        Overrides:
        hashCode in class java.lang.Object
        Since:
        TotalCross 1.25
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares this object against the specified object. The result is 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:

        • If 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.
        • If 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.
        This definition allows hash tables to operate properly.
        Overrides:
        equals in class java.lang.Object
        Since:
        TotalCross 1.25