public final class CompareUtil extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
equal(double n1,
double n2)
Compares two numbers for equality.
|
static boolean |
equal(Object o1,
Object o2)
Compares two objects for equality.
|
static int |
getHashCode(double number)
Returns a hash code for the given number.
|
static int |
getHashCode(Object object)
Returns the hash code of the given object.
|
public static boolean equal(Object o1, Object o2)
Object.equals(Object)
method of the object
with the lower hash code (System.identityHashCode(Object)
);
in the rare case that two different objects have the same hash code, a lock
is used.o1
- an objecto2
- another objectpublic static int getHashCode(Object object)
object
- an objectpublic static boolean equal(double n1, double n2)
Double.equals(Object)
method.n1
- a numbern2
- another numberpublic static int getHashCode(double number)
Double.hashCode()
method.number
- a numberCopyright © 2025 Apache Software Foundation. All rights reserved.