Interface LongComparator

All Superinterfaces:
Comparator<Long>
All Known Implementing Classes:
LongComparators.NaturalImplicitComparator, LongComparators.OppositeComparator, LongComparators.OppositeImplicitComparator, LongComparators.UnsignedComparator, LongComparators.UnsignedOppositeComparator

public interface LongComparator extends Comparator<Long>
A type-specific Comparator; provides methods to compare two primitive types both as objects and as primitive types.
See Also:
  • Method Details

    • compare

      int compare(long k1, long k2)
      Compares its two primitive-type arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
      Returns:
      a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
      See Also:
    • reversed

      default LongComparator reversed()
      Specified by:
      reversed in interface Comparator<Long>
    • compare

      @Deprecated default int compare(Long ok1, Long ok2)
      Deprecated.
      Please use the corresponding type-specific method instead.

      This implementation delegates to the corresponding type-specific method.

      Specified by:
      compare in interface Comparator<Long>
    • thenComparing

      default LongComparator thenComparing(LongComparator second)
      Return a new comparator that first uses this comparator, then uses the second comparator if this comparator compared the two elements as equal.
      See Also:
    • thenComparing

      default Comparator<Long> thenComparing(Comparator<? super Long> second)
      Specified by:
      thenComparing in interface Comparator<Long>