Package org.eclipse.xtext.ide.util
Class RangeComparator
java.lang.Object
org.eclipse.xtext.ide.util.RangeComparator
- All Implemented Interfaces:
Comparator<org.eclipse.lsp4j.Range>
Null-safe comparator for
range
instances.
Compares start positions
first, then
end positions
.
- Author:
- akos.kitta - Initial contribution and API
- See Also:
-
Constructor Summary
ConstructorDescriptionRangeComparator
(PositionComparator positionComparator) Creates a new range comparator with the give comparator delegate forpositions
. -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(org.eclipse.lsp4j.Range left, org.eclipse.lsp4j.Range right) 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 Details
-
RangeComparator
Creates a new range comparator with the give comparator delegate forpositions
.- Parameters:
positionComparator
- the delegate comparator for the positions. Cannot benull
.
-
-
Method Details
-
compare
public int compare(org.eclipse.lsp4j.Range left, org.eclipse.lsp4j.Range right) - Specified by:
compare
in interfaceComparator<org.eclipse.lsp4j.Range>
-