Class BioactiveEntityComparator

  • All Implemented Interfaces:
    Comparator<BioactiveEntity>
    Direct Known Subclasses:
    UnambiguousBioactiveEntityComparator, UnambiguousExactBioactiveEntityComparator

    public class BioactiveEntityComparator
    extends Object
    implements Comparator<BioactiveEntity>
    Unambiguous bioactive entity comparator. It will first use UnambiguousInteractorBaseComparator to compare the basic interactor properties. If the basic interactor properties are the same, It will look first for CHEBI identifier (the interactor with a non null CHEBI identifier will always come first). If the CHEBI identifiers are not set, it will look at the standard inchi key (the interactor with a non null standard inchi key will always come first). If the standard inchi keys are identical, it will look at the smile (the interactor with a non null smile will always come first). If the smiles are identical, it will look at the standard Inchi (the interactor with a non null standard inchi will always come first). This comparator will ignore all the other properties of an interactor.
    Since:
    15/01/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • BioactiveEntityComparator

        public BioactiveEntityComparator​(Comparator<Interactor> interactorBaseComparator)
        Creates a new UnambiguousBioactiveEntityComparator. It will use an UnambiguousInteractorBaseComparator
        Parameters:
        interactorBaseComparator - a Comparator object.
    • Method Detail

      • compare

        public int compare​(BioactiveEntity bioactiveEntity1,
                           BioactiveEntity bioactiveEntity2)
        It will first use UnambiguousInteractorBaseComparator to compare the basic interactor properties. If the basic interactor properties are the same, It will look first for CHEBI identifier (the interactor with a non null CHEBI identifier will always come first). If the CHEBI identifiers are not set, it will look at the standard inchi key (the interactor with a non null standard inchi key will always come first). If the standard inchi keys are identical, it will look at the smile (the interactor with a non null smile will always come first). If the smiles are identical, it will look at the standard Inchi (the interactor with a non null standard inchi will always come first). This comparator will ignore all the other properties of an interactor.
        Specified by:
        compare in interface Comparator<BioactiveEntity>
        Parameters:
        bioactiveEntity1 - a BioactiveEntity object.
        bioactiveEntity2 - a BioactiveEntity object.
        Returns:
        a int.