Package org.antlr.v4.runtime.misc
Interface EqualityComparator<T>
- All Known Implementing Classes:
AbstractEqualityComparator
,ATNConfigSet.ConfigEqualityComparator
,ObjectEqualityComparator
public interface EqualityComparator<T>
This interface provides an abstract concept of object equality independent of
Object.equals(java.lang.Object)
(object equality) and the ==
operator
(reference equality). It can be used to provide algorithm-specific unordered
comparisons without requiring changes to the object itself.- Author:
- Sam Harwell
-
Method Summary
-
Method Details
-
hashCode
This method returns a hash code for the specified object.- Parameters:
obj
- The object.- Returns:
- The hash code for
obj
.
-
equals
This method tests if two objects are equal.- Parameters:
a
- The first object to compare.b
- The second object to compare.- Returns:
true
ifa
equalsb
, otherwisefalse
.
-