Class UnambiguousRangeAndResultingSequenceComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.range.RangeComparator
-
- psidev.psi.mi.jami.utils.comparator.range.RangeAndResultingSequenceComparator
-
- psidev.psi.mi.jami.utils.comparator.range.UnambiguousRangeAndResultingSequenceComparator
-
- All Implemented Interfaces:
Comparator<Range>
public class UnambiguousRangeAndResultingSequenceComparator extends RangeAndResultingSequenceComparator
Unambiguous RangeComparator. It compares first the start Position, then the end Position using a UnambiguousPositionComparator, If start/end positions are equals, the linked ranges will always come before the ranges that are not linked. Then, if the positions and linked boolean are the same, it will compare the resultingSequences using ResultingSequenceComparator - Two ranges which are null are equals - The range which is not null is before null.- Since:
21/05/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description UnambiguousRangeAndResultingSequenceComparator()Creates a new UnambiguousRangeAndResultingSequenceComparator with UnambiguousPositionComparator
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanareEquals(Range range1, Range range2)Use DefaultRangeComparator to know if two ranges are equals.intcompare(Range range1, Range range2)It compares first the start Position, then the end Position using a UnambiguousPositionComparator, If start/end positions are equals, the linked ranges will always come before the ranges that are not linked.UnambiguousPositionComparatorgetPositionComparator()Getter for the fieldpositionComparator.static inthashCode(Range range)hashCode-
Methods inherited from class psidev.psi.mi.jami.utils.comparator.range.RangeAndResultingSequenceComparator
getResultingSequenceComparator
-
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
-
getPositionComparator
public UnambiguousPositionComparator getPositionComparator()
Description copied from class:RangeComparatorGetter for the field
positionComparator.- Overrides:
getPositionComparatorin classRangeComparator- Returns:
- a
PositionComparatorobject.
-
compare
public int compare(Range range1, Range range2)
It compares first the start Position, then the end Position using a UnambiguousPositionComparator, If start/end positions are equals, the linked ranges will always come before the ranges that are not linked. Then, if the positions and linked boolean are the same, it will compare the resultingSequences using ResultingSequenceComparator - Two ranges which are null are equals - The range which is not null is before null.- Specified by:
comparein interfaceComparator<Range>- Overrides:
comparein classRangeAndResultingSequenceComparator- Parameters:
range1- aRangeobject.range2- aRangeobject.- Returns:
- a int.
-
areEquals
public static boolean areEquals(Range range1, Range range2)
Use DefaultRangeComparator to know if two ranges are equals.
-
-