Package org.antlr.v4.runtime.misc
Class ObjectEqualityComparator
java.lang.Object
org.antlr.v4.runtime.misc.AbstractEqualityComparator<Object>
org.antlr.v4.runtime.misc.ObjectEqualityComparator
- All Implemented Interfaces:
EqualityComparator<Object>
This default implementation of
EqualityComparator
uses object equality
for comparisons by calling Object.hashCode()
and Object.equals(java.lang.Object)
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
ObjectEqualityComparator
public ObjectEqualityComparator()
-
-
Method Details
-
hashCode
This method returns a hash code for the specified object.This implementation returns
obj.
hashCode()
.- Parameters:
obj
- The object.- Returns:
- The hash code for
obj
.
-
equals
This method tests if two objects are equal.This implementation relies on object equality. If both objects are
null
, this method returnstrue
. Otherwise if onlya
isnull
, this method returnsfalse
. Otherwise, this method returns the result ofa.
equals
(b)
.- Parameters:
a
- The first object to compare.b
- The second object to compare.- Returns:
true
ifa
equalsb
, otherwisefalse
.
-