Class ExactInteractorBaseComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.interactor.ExactInteractorBaseComparator
-
- All Implemented Interfaces:
Comparator<Interactor>
- Direct Known Subclasses:
UnambiguousExactInteractorBaseComparator
public class ExactInteractorBaseComparator extends Object implements Comparator<Interactor>
Interactor base comparator. It will first compare the interactor types using UnambiguousCvTermComparator. If both types are equal, it will compare organisms using OrganismTaxIdComparator. If both organisms are equal, it will use a UnambiguousInteractorBaseComparator to compare basic Interactor properties.- Since:
17/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description ExactInteractorBaseComparator(OrganismTaxIdComparator organismComparator, Comparator<CvTerm> typeComparator, InteractorBaseComparator interactorBaseComparator)
Creates a new UnambiguousExactInteractorBaseComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Interactor interactor1, Interactor interactor2)
It will first compare the interactor types using UnambiguousCvTermComparator.InteractorBaseComparator
getInteractorBaseComparator()
Getter for the fieldinteractorBaseComparator
.OrganismTaxIdComparator
getOrganismComparator()
Getter for the fieldorganismComparator
.Comparator<CvTerm>
getTypeComparator()
Getter for the fieldtypeComparator
.-
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
-
ExactInteractorBaseComparator
public ExactInteractorBaseComparator(OrganismTaxIdComparator organismComparator, Comparator<CvTerm> typeComparator, InteractorBaseComparator interactorBaseComparator)
Creates a new UnambiguousExactInteractorBaseComparator. It will use a UnambiguousInteractorBaseComparator to compare basic interactor properties, a OrganismTaxIdComparator to compare organisms and a UnambiguousCvTermComparator to compare checksum types and interactor types- Parameters:
organismComparator
- aOrganismTaxIdComparator
object.typeComparator
- aComparator
object.interactorBaseComparator
- aInteractorBaseComparator
object.
-
-
Method Detail
-
getInteractorBaseComparator
public InteractorBaseComparator getInteractorBaseComparator()
Getter for the field
interactorBaseComparator
.- Returns:
- a
InteractorBaseComparator
object.
-
getTypeComparator
public Comparator<CvTerm> getTypeComparator()
Getter for the field
typeComparator
.- Returns:
- a
Comparator
object.
-
getOrganismComparator
public OrganismTaxIdComparator getOrganismComparator()
Getter for the field
organismComparator
.- Returns:
- a
OrganismTaxIdComparator
object.
-
compare
public int compare(Interactor interactor1, Interactor interactor2)
It will first compare the interactor types using UnambiguousCvTermComparator. If both types are equal, it will compare organisms using OrganismTaxIdComparator. If both organisms are equal, it will use a UnambiguousInteractorBaseComparator to compare basic Interactor properties.- Specified by:
compare
in interfaceComparator<Interactor>
- Parameters:
interactor1
- aInteractor
object.interactor2
- aInteractor
object.- Returns:
- a int.
-
-