Class UnambiguousEntityBaseComparator

  • All Implemented Interfaces:
    Comparator<Entity>

    public class UnambiguousEntityBaseComparator
    extends EntityBaseComparator
    Unambiguous entity comparator It will first compare the interactors using UnambiguousInteractorComparator. 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:
    16/01/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • UnambiguousEntityBaseComparator

        public UnambiguousEntityBaseComparator()

        Creates a new UnambiguousEntityBaseComparator. It will use a UnambiguousInteractorComparator to compare interactors

    • Method Detail

      • areEquals

        public static boolean areEquals​(Entity participant1,
                                        Entity participant2)
        Use UnambiguousParticipantBaseComparator 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 UnambiguousInteractorComparator. 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.
        Specified by:
        compare in interface Comparator<Entity>
        Overrides:
        compare in class EntityBaseComparator
        Parameters:
        participant1 - a Entity object.
        participant2 - a Entity object.
        Returns:
        a int.