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 booleanareEquals(Alias alias1, Alias alias2)Use UnambiguousAliasComparator to know if two aliases are equals.intcompare(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.UnambiguousCvTermComparatorgetTypeComparator()Getter for the fieldtypeComparator.static inthashCode(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:
getTypeComparatorin classAliasComparator- Returns:
- a
Comparatorobject.
-
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:
comparein interfaceComparator<Alias>- Overrides:
comparein classAliasComparator- Parameters:
alias1- aAliasobject.alias2- aAliasobject.- Returns:
- the comparison value
-
areEquals
public static boolean areEquals(Alias alias1, Alias alias2)
Use UnambiguousAliasComparator to know if two aliases are equals.
-
-