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 int
compare(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
- aComparator
object.aliasComparator
- aAliasComparator
object.
-
InteractorBaseComparator
public InteractorBaseComparator(CollectionComparator<Xref> identifierComparator, CollectionComparator<Alias> aliasComparator)
Constructor for InteractorBaseComparator.
- Parameters:
identifierComparator
- aCollectionComparator
object.aliasComparator
- aCollectionComparator
object.
-
-
Method Detail
-
getIdentifierComparator
public Comparator<Xref> getIdentifierComparator()
Getter for the field
identifierComparator
.- Returns:
- a
Comparator
object.
-
getAliasComparator
public Comparator<Alias> getAliasComparator()
Getter for the field
aliasComparator
.- Returns:
- a
Comparator
object.
-
getIdentifierCollectionComparator
public CollectionComparator<Xref> getIdentifierCollectionComparator()
Getter for the field
identifierCollectionComparator
.- Returns:
- a
CollectionComparator
object.
-
getAliasCollectionComparator
public CollectionComparator<Alias> getAliasCollectionComparator()
Getter for the field
aliasCollectionComparator
.- Returns:
- a
CollectionComparator
object.
-
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:
compare
in interfaceComparator<Interactor>
- Parameters:
interactor1
- aInteractor
object.interactor2
- aInteractor
object.- Returns:
- a int.
-
-