Class DocumentHighlightComparator

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

    public class DocumentHighlightComparator
    extends java.lang.Object
    implements java.util.Comparator<org.eclipse.lsp4j.DocumentHighlight>
    Null-safe comparator for document highlight instances.

    Compares ranges first, then the highlight kinds based on the natural ordering.

    See Also:
    RangeComparator
    • Constructor Summary

      Constructors 
      Constructor Description
      DocumentHighlightComparator​(RangeComparator rangeComparator)
      Creates a new document highlight comparator instance with the delegate comparator for ranges.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(org.eclipse.lsp4j.DocumentHighlight left, org.eclipse.lsp4j.DocumentHighlight 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

      • DocumentHighlightComparator

        @Inject
        public DocumentHighlightComparator​(RangeComparator rangeComparator)
        Creates a new document highlight comparator instance with the delegate comparator for ranges.
        Parameters:
        rangeComparator - the comparator used for the ranges. Cannot be null.
    • Method Detail

      • compare

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