Class ParticipantBaseComparator

    • Constructor Detail

      • ParticipantBaseComparator

        public ParticipantBaseComparator​(EntityBaseComparator interactorComparator,
                                         Comparator<CvTerm> cvTermComparator)
        Creates a new ParticipantBaseComparator
        Parameters:
        interactorComparator - : interactor comparator required for comparing the molecules
        cvTermComparator - : CvTerm comparator required for comparing biological roles
    • Method Detail

      • getCvTermComparator

        public Comparator<CvTerm> getCvTermComparator()

        Getter for the field cvTermComparator.

        Returns:
        a Comparator object.
      • isIgnoreInteractors

        public boolean isIgnoreInteractors()

        isIgnoreInteractors

        Returns:
        a boolean.
      • setIgnoreInteractors

        public void setIgnoreInteractors​(boolean ignoreInteractors)

        setIgnoreInteractors

        Parameters:
        ignoreInteractors - a boolean.
      • isIgnoreStoichiometry

        public boolean isIgnoreStoichiometry()

        isIgnoreStoichiometry

        Returns:
        a boolean.
      • setIgnoreStoichiometry

        public void setIgnoreStoichiometry​(boolean ignoreStoichiometry)

        setIgnoreStoichiometry

        Parameters:
        ignoreStoichiometry - a boolean.
      • compare

        public int compare​(Participant participant1,
                           Participant participant2)
        It will first compare the interactors using InteractorComparator. If both interactors are the same, it will compare the biological roles using AbstractCvTermComparator. If both biological roles are the same, it will look at the stoichiometry (participant with lower stoichiometry will come first). If the stoichiometry is the same for both participants, it will compare the features using a Comparator of type Feature.

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

        Specified by:
        compare in interface Comparator<Participant>
        Parameters:
        participant1 - a Participant object.
        participant2 - a Participant object.
        Returns:
        a int.