public class EquivalenceGrouper<T extends BioPAXElement>
extends Object
Utility class for equivalence based comparison of a set of BioPAXElements.
BioPAXElement by default uses equals and hash code methods based on the type and URI.
On the other hand for many elements it is possible to determine semantic equivalence
among elements. For example two entityFeatures with exactly the same type and location
are equivalent. This logic is implemented in isEquivalent() and equivalenceCode()
methods.
For most Java collections that uses hashCode and equals there is no easy way to plug-in a
comparator to switch to different comparison behavior. This is a simple Set implementation that uses
equivalence codes when possible. It uses HashMap as the underlying implementation and will use a special bucket in
the case of clashes.