Class InteractorBaseComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.interactor.InteractorBaseComparator
-
- All Implemented Interfaces:
Comparator<Interactor>
- Direct Known Subclasses:
UnambiguousInteractorBaseComparator
public class InteractorBaseComparator extends Object implements Comparator<Interactor>
nteractor comparator It will only compare identifiers if one interactor does have identifiers using UnambiguousIdentifierComparator. Otherwise, it will first compare shortNames (case sensitive) fullnames(case sensitive) and if the shortNames and fullnames are the same, it will compare the aliases using UnambiguousAliasComparator. This comparator will ignore all the other properties of an interactor.- Since:
21/12/12
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description InteractorBaseComparator(Comparator<Xref> identifierComparator, AliasComparator aliasComparator)Constructor for InteractorBaseComparator.InteractorBaseComparator(CollectionComparator<Xref> identifierComparator, CollectionComparator<Alias> aliasComparator)Constructor for InteractorBaseComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Interactor interactor1, Interactor interactor2)It will only compare identifiers if one interactor does have identifiers using UnambiguousIdentifierComparator.CollectionComparator<Alias>getAliasCollectionComparator()Getter for the fieldaliasCollectionComparator.Comparator<Alias>getAliasComparator()Getter for the fieldaliasComparator.CollectionComparator<Xref>getIdentifierCollectionComparator()Getter for the fieldidentifierCollectionComparator.Comparator<Xref>getIdentifierComparator()Getter for the fieldidentifierComparator.-
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
-
InteractorBaseComparator
public InteractorBaseComparator(Comparator<Xref> identifierComparator, AliasComparator aliasComparator)
Constructor for InteractorBaseComparator.
- Parameters:
identifierComparator- aComparatorobject.aliasComparator- aAliasComparatorobject.
-
InteractorBaseComparator
public InteractorBaseComparator(CollectionComparator<Xref> identifierComparator, CollectionComparator<Alias> aliasComparator)
Constructor for InteractorBaseComparator.
- Parameters:
identifierComparator- aCollectionComparatorobject.aliasComparator- aCollectionComparatorobject.
-
-
Method Detail
-
getIdentifierComparator
public Comparator<Xref> getIdentifierComparator()
Getter for the field
identifierComparator.- Returns:
- a
Comparatorobject.
-
getAliasComparator
public Comparator<Alias> getAliasComparator()
Getter for the field
aliasComparator.- Returns:
- a
Comparatorobject.
-
getIdentifierCollectionComparator
public CollectionComparator<Xref> getIdentifierCollectionComparator()
Getter for the field
identifierCollectionComparator.- Returns:
- a
CollectionComparatorobject.
-
getAliasCollectionComparator
public CollectionComparator<Alias> getAliasCollectionComparator()
Getter for the field
aliasCollectionComparator.- Returns:
- a
CollectionComparatorobject.
-
compare
public int compare(Interactor interactor1, Interactor interactor2)
It will only compare identifiers if one interactor does have identifiers using UnambiguousIdentifierComparator. Otherwise, it will first compare shortNames (case sensitive) fullnames(case sensitive) and if the shortNames and fullnames are the same, it will compare the aliases using UnambiguousAliasComparator. This comparator will ignore all the other properties of an interactor.- Specified by:
comparein interfaceComparator<Interactor>- Parameters:
interactor1- aInteractorobject.interactor2- aInteractorobject.- Returns:
- a int.
-
-