Class RangeComparator

java.lang.Object
org.eclipse.xtext.ide.util.RangeComparator
All Implemented Interfaces:
Comparator<org.eclipse.lsp4j.Range>

public class RangeComparator extends Object implements 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 Details

    • RangeComparator

      @Inject public RangeComparator(PositionComparator positionComparator)
      Creates a new range comparator with the give comparator delegate for positions.
      Parameters:
      positionComparator - the delegate comparator for the positions. Cannot be null.
  • Method Details

    • compare

      public int compare(org.eclipse.lsp4j.Range left, org.eclipse.lsp4j.Range right)
      Specified by:
      compare in interface Comparator<org.eclipse.lsp4j.Range>