Class ComparatorUtils
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.ComparatorUtils
-
public class ComparatorUtils extends Object
Utility class for Comparator- Since:
01/02/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description ComparatorUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
areCvTermsEqual(Collection<? extends CvTerm> method1, Collection<? extends CvTerm> method2)
areCvTermsEqualstatic boolean
areParametersEqual(Collection<? extends Parameter> method1, Collection<? extends Parameter> method2)
areParametersEqualstatic boolean
areRangesEqual(Collection<? extends Range> method1, Collection<? extends Range> method2)
areRangesEqualstatic int
compareIdentifiersWithDefaultIdentifier(String identifier1, String identifier2, String firstIdentifier)
If identifier1 and identifier2 are equals, it returns 0.static boolean
findAtLeastOneMatchingAlias(Collection<? extends Alias> aliases1, Collection<? extends Alias> aliases2)
findAtLeastOneMatchingAliasstatic boolean
findAtLeastOneMatchingIdentifier(Collection<? extends Xref> identifiers1, Collection<? extends Xref> identifiers2)
True if there is at least one identifier in identifiers1 that is identical to at least one identifier in identfiers2 ( equality based on DefaultExternalIdentifierComparator.areEquals)
-
-
-
Method Detail
-
compareIdentifiersWithDefaultIdentifier
public static int compareIdentifiersWithDefaultIdentifier(String identifier1, String identifier2, String firstIdentifier)
If identifier1 and identifier2 are equals, it returns 0. If identifier1 and identifier2 are not equals: - the external identifier that is equal to firstIdentifier will always come first - if both external identifiers are different from the the first identifier, it will return the results of identifier1.compareTo(identifier2)- Parameters:
identifier1
- : first identifier to compareidentifier2
- : second identifier to comparefirstIdentifier
- : the default identifier that we want to have first- Returns:
- a int.
-
findAtLeastOneMatchingIdentifier
public static boolean findAtLeastOneMatchingIdentifier(Collection<? extends Xref> identifiers1, Collection<? extends Xref> identifiers2)
True if there is at least one identifier in identifiers1 that is identical to at least one identifier in identfiers2 ( equality based on DefaultExternalIdentifierComparator.areEquals)- Parameters:
identifiers1
- aCollection
object.identifiers2
- aCollection
object.- Returns:
- a boolean.
-
findAtLeastOneMatchingAlias
public static boolean findAtLeastOneMatchingAlias(Collection<? extends Alias> aliases1, Collection<? extends Alias> aliases2)
findAtLeastOneMatchingAlias
- Parameters:
aliases1
- aCollection
object.aliases2
- aCollection
object.- Returns:
- a boolean.
-
areCvTermsEqual
public static boolean areCvTermsEqual(Collection<? extends CvTerm> method1, Collection<? extends CvTerm> method2)
areCvTermsEqual
- Parameters:
method1
- aCollection
object.method2
- aCollection
object.- Returns:
- a boolean.
-
areParametersEqual
public static boolean areParametersEqual(Collection<? extends Parameter> method1, Collection<? extends Parameter> method2)
areParametersEqual
- Parameters:
method1
- aCollection
object.method2
- aCollection
object.- Returns:
- a boolean.
-
areRangesEqual
public static boolean areRangesEqual(Collection<? extends Range> method1, Collection<? extends Range> method2)
areRangesEqual
- Parameters:
method1
- aCollection
object.method2
- aCollection
object.- Returns:
- a boolean.
-
-