Class EquivalenceGrouper<T extends BioPAXElement>

java.lang.Object
org.biopax.paxtools.util.EquivalenceGrouper<T>

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.
  • Constructor Details

    • EquivalenceGrouper

      public EquivalenceGrouper(Set<? extends T> bpes)
    • EquivalenceGrouper

      public EquivalenceGrouper()
  • Method Details

    • getBuckets

      public HashSet<? extends List<T>> getBuckets()
    • access

      public EquivalenceGrouper<T>.org.biopax.paxtools.util.EquivalenceGrouper.EquivalanceBucket<T> access(T element)
    • add

      public void add(T bpe)