/** * Determines if this number is equal to another. * * @param comparator The object to compare to. * * @return <tt>true</tt> if the comparator is a number equal in value to this one, <tt>false</tt> otherwise. */ public boolean equals(Object comparator) { if (this == comparator) { return true; } if ((comparator == null) || !(comparator instanceof NumericType)) { return false; } NumericType comparatorNumber = (NumericType) comparator; return value == comparatorNumber.longValue(); }
/** * Determines if this number is equal to another. * * @param comparator The object to compare to. * * @return <tt>true</tt> if the comparator is a number equal in value to this one, <tt>false</tt> otherwise. */ public boolean equals(Object comparator) { if (this == comparator) { return true; } if ((comparator == null) || !(comparator instanceof NumericType)) { return false; } NumericType comparatorNumber = (NumericType) comparator; return value == comparatorNumber.longValue(); }