Ejemplo n.º 1
0
 /**
  * Compares this object to the specified object.
  *
  * @param obj the object to compare with.
  * @return <code>true</code> if the objects are the same; <code>false</code> otherwise.
  */
 @Override
 public boolean equals(Object obj) {
   if (obj != null) {
     if (ClassUtil.isInstance(Short.class, obj)) {
       return obj.equals(value);
     }
     if (ClassUtil.isInstance(MutableShort.class, obj)) {
       return value == ((MutableShort) obj).value;
     }
   }
   return false;
 }
Ejemplo n.º 2
0
 /**
  * Compares this object to the specified object.
  *
  * @param obj the object to compare with.
  * @return <code>true</code> if the objects are the same; <code>false</code> otherwise.
  */
 @Override
 public boolean equals(Object obj) {
   if (obj != null) {
     if (ClassUtil.isInstance(Double.class, obj)) {
       return obj.equals(value);
     }
     if (ClassUtil.isInstance(MutableDouble.class, obj)) {
       return Double.doubleToLongBits(value)
           == Double.doubleToLongBits(((MutableDouble) obj).value);
     }
   }
   return false;
 }