Class EntityBaseComparator

  • All Implemented Interfaces:
    Comparator<Entity>
    Direct Known Subclasses:
    UnambiguousEntityBaseComparator, UnambiguousExactEntityBaseComparator

    public class EntityBaseComparator
    extends Object
    implements Comparator<Entity>
    Basic entity comparator. It will first compare the interactors using InteractorComparator. If both interactors 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.

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

      • EntityBaseComparator

        public EntityBaseComparator​(InteractorComparator interactorComparator)
        Creates a new EntityBaseComparator
        Parameters:
        interactorComparator - : interactor comparator required for comparing the molecules
    • Method Detail

      • isIgnoreStoichiometry

        public boolean isIgnoreStoichiometry()

        isIgnoreStoichiometry

        Returns:
        a boolean.
      • setIgnoreStoichiometry

        public void setIgnoreStoichiometry​(boolean ignoreStoichiometry)

        setIgnoreStoichiometry

        Parameters:
        ignoreStoichiometry - a boolean.
      • isIgnoreInteractors

        public boolean isIgnoreInteractors()

        isIgnoreInteractors

        Returns:
        a boolean.
      • setIgnoreInteractors

        public void setIgnoreInteractors​(boolean ignoreInteractors)

        Setter for the field ignoreInteractors.

        Parameters:
        ignoreInteractors - a boolean.
      • compare

        public int compare​(Entity participant1,
                           Entity participant2)
        It will first compare the interactors using InteractorComparator. If both interactors 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<Entity>
        Parameters:
        participant1 - a Entity object.
        participant2 - a Entity object.
        Returns:
        a int.