Package org.biopax.paxtools.util
Class EquivalenceGrouper<T extends BioPAXElement>
java.lang.Object
org.biopax.paxtools.util.EquivalenceGrouper<T>
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.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
EquivalenceGrouper
-
EquivalenceGrouper
public EquivalenceGrouper()
-
-
Method Details
-
getBuckets
-
access
public EquivalenceGrouper<T>.org.biopax.paxtools.util.EquivalenceGrouper.EquivalanceBucket<T> access(T element) -
add
-