Class FeatureEvidenceComparator

  • All Implemented Interfaces:
    Comparator<FeatureEvidence>
    Direct Known Subclasses:
    UnambiguousFeatureEvidenceComparator

    public class FeatureEvidenceComparator
    extends Object
    implements Comparator<FeatureEvidence>
    Basic FeatureEvidence comparator. It will first compare feature detection methods using AbstractCvTermComparator. If both feature detection methods are the same, it will use a AbstractFeatureBaseComparator to compare basic properties of a feature. This comparator will ignore all the other properties of an experimental feature.
    Since:
    16/01/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • FeatureEvidenceComparator

        public FeatureEvidenceComparator​(Comparator<Feature> featureComparator,
                                         Comparator<CvTerm> cvTermComparator)
        Creates a new FeatureEvidenceComparator.
        Parameters:
        featureComparator - : feature comparator required for comparing basic feature properties
        cvTermComparator - a Comparator object.
    • Method Detail

      • getFeatureComparator

        public Comparator<Feature> getFeatureComparator()

        Getter for the field featureComparator.

        Returns:
        a Comparator object.
      • compare

        public int compare​(FeatureEvidence experimentalFeature1,
                           FeatureEvidence experimentalFeature2)
        It will first use a AbstractFeatureBaseComparator to compare basic properties of a feature. If the basic feature properties are the same, it will then compare feature detection methods using AbstractCvTermComparator. This comparator will ignore all the other properties of an experimental feature.
        Specified by:
        compare in interface Comparator<FeatureEvidence>
        Parameters:
        experimentalFeature1 - a FeatureEvidence object.
        experimentalFeature2 - a FeatureEvidence object.
        Returns:
        a int.