Class InteractorComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.interactor.InteractorComparator
-
- All Implemented Interfaces:
Comparator<Interactor>
- Direct Known Subclasses:
UnambiguousExactInteractorComparator
,UnambiguousInteractorComparator
public class InteractorComparator extends Object implements Comparator<Interactor>
Generic Interactor Comparator. Bioactive entities come first, then proteins, then genes, then nucleic acids, then interactorSet and finally Complexes. If two interactors are from the same Interactor interface, it will use a more specific Comparator : - Uses AbstractBioactiveEntityComparator for comparing BioactiveEntity objects. - Uses AbstractProteinComparator for comparing Protein objects. - Uses AbstractGeneComparator for comparing Gene objects. - Uses AbstractNucleicAcidComparator for comparing NucleicAcids objects. - Uses InteractorPoolComparator for comparing interactor candidates - Uses ComplexComparator for comparing complexes - Uses AbstractPolymerComparator for comparing polymers - use AbstractInteractorBaseComparator for comparing basic interactors that are not one of the above.- Since:
16/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description InteractorComparator(Comparator<Interactor> interactorBaseComparator, Comparator<Complex> complexComparator, Comparator<Polymer> polymerComparator, Comparator<BioactiveEntity> bioactiveEntityComparator, Comparator<Gene> geneComparator, Comparator<NucleicAcid> nucleicAcidComparator, Comparator<Protein> proteinComparator)
Creates a new InteractorComparator.InteractorComparator(Comparator<Interactor> interactorBaseComparator, Comparator<Complex> complexComparator, Comparator<Polymer> polymerComparator, Comparator<BioactiveEntity> bioactiveEntityComparator, Comparator<Gene> geneComparator, Comparator<NucleicAcid> nucleicAcidComparator, Comparator<Protein> proteinComparator, Comparator<InteractorPool> poolComparator)
Constructor for InteractorComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Interactor interactor1, Interactor interactor2)
Bioactive entities come first, then proteins, then genes, then nucleic acids, then complexes and finally InteractorPool.Comparator<BioactiveEntity>
getBioactiveEntityComparator()
Getter for the fieldbioactiveEntityComparator
.Comparator<Complex>
getComplexComparator()
Getter for the fieldcomplexComparator
.Comparator<Gene>
getGeneComparator()
Getter for the fieldgeneComparator
.Comparator<Interactor>
getInteractorBaseComparator()
Getter for the fieldinteractorBaseComparator
.Comparator<InteractorPool>
getInteractorCandidatesComparator()
Getter for the fieldinteractorCandidatesComparator
.Comparator<NucleicAcid>
getNucleicAcidComparator()
Getter for the fieldnucleicAcidComparator
.Comparator<Polymer>
getPolymerComparator()
Getter for the fieldpolymerComparator
.Comparator<Protein>
getProteinComparator()
Getter for the fieldproteinComparator
.-
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
-
InteractorComparator
public InteractorComparator(Comparator<Interactor> interactorBaseComparator, Comparator<Complex> complexComparator, Comparator<Polymer> polymerComparator, Comparator<BioactiveEntity> bioactiveEntityComparator, Comparator<Gene> geneComparator, Comparator<NucleicAcid> nucleicAcidComparator, Comparator<Protein> proteinComparator)
Creates a new InteractorComparator.- Parameters:
interactorBaseComparator
- : required to create more specific comparators and to compare basic interactor objectscomplexComparator
- : required to compare complex objectspolymerComparator
- aComparator
object.bioactiveEntityComparator
- aComparator
object.geneComparator
- aComparator
object.nucleicAcidComparator
- aComparator
object.proteinComparator
- aComparator
object.
-
InteractorComparator
public InteractorComparator(Comparator<Interactor> interactorBaseComparator, Comparator<Complex> complexComparator, Comparator<Polymer> polymerComparator, Comparator<BioactiveEntity> bioactiveEntityComparator, Comparator<Gene> geneComparator, Comparator<NucleicAcid> nucleicAcidComparator, Comparator<Protein> proteinComparator, Comparator<InteractorPool> poolComparator)
Constructor for InteractorComparator.
- Parameters:
interactorBaseComparator
- aComparator
object.complexComparator
- aComparator
object.polymerComparator
- aComparator
object.bioactiveEntityComparator
- aComparator
object.geneComparator
- aComparator
object.nucleicAcidComparator
- aComparator
object.proteinComparator
- aComparator
object.poolComparator
- aComparator
object.
-
-
Method Detail
-
getBioactiveEntityComparator
public Comparator<BioactiveEntity> getBioactiveEntityComparator()
Getter for the field
bioactiveEntityComparator
.- Returns:
- a
Comparator
object.
-
getGeneComparator
public Comparator<Gene> getGeneComparator()
Getter for the field
geneComparator
.- Returns:
- a
Comparator
object.
-
getProteinComparator
public Comparator<Protein> getProteinComparator()
Getter for the field
proteinComparator
.- Returns:
- a
Comparator
object.
-
getNucleicAcidComparator
public Comparator<NucleicAcid> getNucleicAcidComparator()
Getter for the field
nucleicAcidComparator
.- Returns:
- a
Comparator
object.
-
getInteractorBaseComparator
public Comparator<Interactor> getInteractorBaseComparator()
Getter for the field
interactorBaseComparator
.- Returns:
- a
Comparator
object.
-
getComplexComparator
public Comparator<Complex> getComplexComparator()
Getter for the field
complexComparator
.- Returns:
- a
Comparator
object.
-
getPolymerComparator
public Comparator<Polymer> getPolymerComparator()
Getter for the field
polymerComparator
.- Returns:
- a
Comparator
object.
-
getInteractorCandidatesComparator
public Comparator<InteractorPool> getInteractorCandidatesComparator()
Getter for the field
interactorCandidatesComparator
.- Returns:
- a
Comparator
object.
-
compare
public int compare(Interactor interactor1, Interactor interactor2)
Bioactive entities come first, then proteins, then genes, then nucleic acids, then complexes and finally InteractorPool. If two interactors are from the same Interactor interface, it will use a more specific Comparator : - Uses AbstractBioactiveEntityComparator for comparing BioactiveEntity objects. - Uses AbstractProteinComparator for comparing Protein objects. - Uses AbstractGeneComparator for comparing Gene objects. - Uses AbstractNucleicAcidComparator for comparing NucleicAcids objects. - Uses InteractorPoolComparator for comparing interactor candidates - Uses polymerComparator for comparing Polymer objects. - use AbstractInteractorBaseComparator for comparing basic interactors that are not one of the above.- Specified by:
compare
in interfaceComparator<Interactor>
- Parameters:
interactor1
- aInteractor
object.interactor2
- aInteractor
object.- Returns:
- a int.
-
-