Class FeatureBaseComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.feature.FeatureBaseComparator
-
- All Implemented Interfaces:
Comparator<Feature>
- Direct Known Subclasses:
UnambiguousFeatureBaseComparator
public class FeatureBaseComparator extends Object implements Comparator<Feature>
feature comparator. It will look first at the feature shortnames (case insensitive). Then, it will compare the feature types using a UnambiguousCvTermComparator. If the feature types are the same, it will compare interactionEffect and then interactionDependency using UnambiguousCvTermComparator. Then it will compare interpro identifier and if the features do not have an interpro identifier, it will look for at the identifiers in the feature identifiers using UnambiguousIdentifierComparator. Finally, it will look at the ranges using UnambiguousRangeComparator.- Since:
16/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description FeatureBaseComparator(Comparator<CvTerm> cvComparator, Comparator<Xref> identifierComparator, RangeComparator rangeComparator)Creates a new UnambiguousFeatureBaseComparator.FeatureBaseComparator(Comparator<CvTerm> cvComparator, CollectionComparator<Xref> identifierComparator, CollectionComparator<Range> rangeComparator)Constructor for FeatureBaseComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Feature feature1, Feature feature2)It will look first at the feature shortnames (case insensitive).Comparator<CvTerm>getCvTermComparator()Getter for the fieldcvTermComparator.CollectionComparator<Xref>getExternalIdentifierCollectionComparator()Getter for the fieldexternalIdentifierCollectionComparator.Comparator<Xref>getIdentifierComparator()Getter for the fieldidentifierComparator.CollectionComparator<Range>getRangeCollectionComparator()Getter for the fieldrangeCollectionComparator.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
FeatureBaseComparator
public FeatureBaseComparator(Comparator<CvTerm> cvComparator, Comparator<Xref> identifierComparator, RangeComparator rangeComparator)
Creates a new UnambiguousFeatureBaseComparator. It will use a UnambiguousCvTermComparator to compare feature types and range status, a UnambiguousExternalIdentifierComparator to compare identifiers and a UnambiguousRangeComparator to compare ranges- Parameters:
cvComparator- aComparatorobject.identifierComparator- aComparatorobject.rangeComparator- aRangeComparatorobject.
-
FeatureBaseComparator
public FeatureBaseComparator(Comparator<CvTerm> cvComparator, CollectionComparator<Xref> identifierComparator, CollectionComparator<Range> rangeComparator)
Constructor for FeatureBaseComparator.
- Parameters:
cvComparator- aComparatorobject.identifierComparator- aCollectionComparatorobject.rangeComparator- aCollectionComparatorobject.
-
-
Method Detail
-
getExternalIdentifierCollectionComparator
public CollectionComparator<Xref> getExternalIdentifierCollectionComparator()
Getter for the field
externalIdentifierCollectionComparator.- Returns:
- a
CollectionComparatorobject.
-
compare
public int compare(Feature feature1, Feature feature2)
It will look first at the feature shortnames (case insensitive). Then, it will compare the feature types using a UnambiguousCvTermComparator. If the feature types are the same, it will compare interactionEffect and then interactionDependency using UnambiguousCvTermComparator. Then it will compare interpro identifier and if the features do not have an interpro identifier, it will look for at the identifiers in the feature identifiers using UnambiguousIdentifierComparator. Finally, it will look at the ranges using UnambiguousRangeComparator.- Specified by:
comparein interfaceComparator<Feature>- Parameters:
feature1- aFeatureobject.feature2- aFeatureobject.- Returns:
- a int.
-
getCvTermComparator
public Comparator<CvTerm> getCvTermComparator()
Getter for the field
cvTermComparator.- Returns:
- a
Comparatorobject.
-
getIdentifierComparator
public Comparator<Xref> getIdentifierComparator()
Getter for the field
identifierComparator.- Returns:
- a
Comparatorobject.
-
getRangeCollectionComparator
public CollectionComparator<Range> getRangeCollectionComparator()
Getter for the field
rangeCollectionComparator.- Returns:
- a
CollectionComparatorobject.
-
-