Class UnambiguousExactEntityBaseComparator

  • All Implemented Interfaces:
    Comparator<Entity>

    public class UnambiguousExactEntityBaseComparator
    extends EntityBaseComparator
    Unambiguous exact entity comparator It will first compare the interactors using UnambiguousExactInteractorComparator. If both interactors are the same, it will look at the stoichiometry (participant with lower stoichiometry will come first).

    This comparator will ignore all the other properties of a participant.

    Since:
    18/01/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • UnambiguousExactEntityBaseComparator

        public UnambiguousExactEntityBaseComparator()

        Creates a new UnambiguousExactParticipantBaseComparator. It will use a UnambiguousExactInteractorComparator to compare interactors, a UnambiguousCvTermComparator to compare biological roles.

    • Method Detail

      • areEquals

        public static boolean areEquals​(Entity participant1,
                                        Entity participant2)
        Use UnambiguousExactParticipantBaseComparator to know if two participants are equals.
        Parameters:
        participant1 - a Entity object.
        participant2 - a Entity object.
        Returns:
        true if the two participants are equal
      • hashCode

        public static int hashCode​(Entity participant)

        hashCode

        Parameters:
        participant - a Entity object.
        Returns:
        the hashcode consistent with the equals method for this comparator
      • compare

        public int compare​(Entity participant1,
                           Entity participant2)
        It will first compare the interactors using UnambiguousExactInteractorComparator. If both interactors are the same, it will look at the stoichiometry (participant with lower stoichiometry will come first).
        Specified by:
        compare in interface Comparator<Entity>
        Overrides:
        compare in class EntityBaseComparator
        Parameters:
        participant1 - a Entity object.
        participant2 - a Entity object.
        Returns:
        a int.