Class RangeComparator

  • All Implemented Interfaces:
    java.util.Comparator<org.eclipse.lsp4j.Range>

    public class RangeComparator
    extends java.lang.Object
    implements java.util.Comparator<org.eclipse.lsp4j.Range>
    Null-safe comparator for range instances.

    Compares start positions first, then end positions.

    See Also:
    PositionComparator
    • Constructor Summary

      Constructors 
      Constructor Description
      RangeComparator​(PositionComparator positionComparator)
      Creates a new range comparator with the give comparator delegate for positions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int 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 Detail

      • 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 Detail

      • compare

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