Class ComplexComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.interactor.ComplexComparator
-
- All Implemented Interfaces:
Comparator<Complex>
- Direct Known Subclasses:
UnambiguousComplexComparator
,UnambiguousExactComplexComparator
public class ComplexComparator extends Object implements Comparator<Complex>
Basic ComplexComparator. It will first look at the default properties of an interactor using AbstractInteractorBaseComparator. It will then compare the interaction types using AbstractCvtermComparator If the basic interactor properties are the same, It will first compare the collection of components using ModelledParticipantComparator.- Since:
17/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description ComplexComparator(Comparator<Interactor> interactorBaseComparator, CustomizableModelledParticipantComparator componentComparator, Comparator<CvTerm> cvTermComparator)
Creates a bew ComplexComparator.ComplexComparator(Comparator<Interactor> interactorBaseComparator, ModelledParticipantCollectionComparator componentComparator, Comparator<CvTerm> cvTermComparator)
Creates a bew ComplexComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Complex complex1, Complex complex2)
It will first look at the default properties of an interactor using AbstractInteractorBaseComparator.ModelledParticipantCollectionComparator
getComponentCollectionComparator()
Getter for the fieldcomponentCollectionComparator
.Comparator<CvTerm>
getCvTermComparator()
Getter for the fieldcvTermComparator
.Comparator<Interactor>
getInteractorBaseComparator()
Getter for the fieldinteractorBaseComparator
.-
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
-
ComplexComparator
public ComplexComparator(Comparator<Interactor> interactorBaseComparator, CustomizableModelledParticipantComparator componentComparator, Comparator<CvTerm> cvTermComparator)
Creates a bew ComplexComparator. It needs a AbstractInteractorBaseComparator to compares interactor properties- Parameters:
interactorBaseComparator
- aComparator
object.componentComparator
- aCustomizableModelledParticipantComparator
object.cvTermComparator
- aComparator
object.
-
ComplexComparator
public ComplexComparator(Comparator<Interactor> interactorBaseComparator, ModelledParticipantCollectionComparator componentComparator, Comparator<CvTerm> cvTermComparator)
Creates a bew ComplexComparator. It needs a AbstractInteractorBaseComparator to compares interactor properties- Parameters:
interactorBaseComparator
- aComparator
object.componentComparator
- aModelledParticipantCollectionComparator
object.cvTermComparator
- aComparator
object.
-
-
Method Detail
-
compare
public int compare(Complex complex1, Complex complex2)
It will first look at the default properties of an interactor using AbstractInteractorBaseComparator. It will then compare the interaction types using AbstractCvtermComparator If the basic interactor properties are the same, It will first compare the collection of components using ComponentComparator.- Specified by:
compare
in interfaceComparator<Complex>
- Parameters:
complex1
- aComplex
object.complex2
- aComplex
object.- Returns:
- a int.
-
getInteractorBaseComparator
public Comparator<Interactor> getInteractorBaseComparator()
Getter for the field
interactorBaseComparator
.- Returns:
- a
Comparator
object.
-
getComponentCollectionComparator
public ModelledParticipantCollectionComparator getComponentCollectionComparator()
Getter for the field
componentCollectionComparator
.- Returns:
- a
ModelledParticipantCollectionComparator
object.
-
getCvTermComparator
public Comparator<CvTerm> getCvTermComparator()
Getter for the field
cvTermComparator
.- Returns:
- a
Comparator
object.
-
-