Class UnambiguousAliasComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.alias.AliasComparator
-
- psidev.psi.mi.jami.utils.comparator.alias.UnambiguousAliasComparator
-
- All Implemented Interfaces:
Comparator<Alias>
public class UnambiguousAliasComparator extends AliasComparator
Unambiguous alias comparator. It will first compare alias types using UnambiguousCvTermComparator and then alias names (case sensitive) - Two aliases which are null are equals - The alias which is not null is before null. - If the alias types are not set, compares the names (case sensitive) - If both alias types are set, use UnambiguousCvTermComparator to compare the alias types. If they are equals, compares the names (case sensitive)- Since:
18/12/12
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description UnambiguousAliasComparator()
Creates a new AliasComparator with DefaultCvTermComparator
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(Alias alias1, Alias alias2)
Use UnambiguousAliasComparator to know if two aliases are equals.int
compare(Alias alias1, Alias alias2)
It will first compare alias types and then alias names (case sensitive) - Two aliases which are null are equals - The alias which is not null is before null.UnambiguousCvTermComparator
getTypeComparator()
Getter for the fieldtypeComparator
.static int
hashCode(Alias alias)
hashCode-
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
-
-
-
-
Method Detail
-
getTypeComparator
public UnambiguousCvTermComparator getTypeComparator()
Getter for the field
typeComparator
.- Overrides:
getTypeComparator
in classAliasComparator
- Returns:
- a
Comparator
object.
-
compare
public int compare(Alias alias1, Alias alias2)
It will first compare alias types and then alias names (case sensitive) - Two aliases which are null are equals - The alias which is not null is before null. - If the alias types are not set, compares the names (case sensitive) - If both alias types are set, use CvTermComparator to compare the alias types. If they are equals, compares the names (case sensitive) It will first compare alias types using UnambiguousCvTermComparator and then alias names (case sensitive) - Two aliases which are null are equals - The alias which is not null is before null. - If the alias types are not set, compares the names (case sensitive) - If both alias types are set, use UnambiguousCvTermComparator to compare the alias types. If they are equals, compares the names (case sensitive)- Specified by:
compare
in interfaceComparator<Alias>
- Overrides:
compare
in classAliasComparator
- Parameters:
alias1
- aAlias
object.alias2
- aAlias
object.- Returns:
- the comparison value
-
areEquals
public static boolean areEquals(Alias alias1, Alias alias2)
Use UnambiguousAliasComparator to know if two aliases are equals.
-
-