Interface CharComparator

  • All Superinterfaces:
    java.util.Comparator<java.lang.Character>
    All Known Implementing Classes:
    AbstractCharComparator
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface CharComparator
    extends java.util.Comparator<java.lang.Character>
    A type-specific Comparator; provides methods to compare two primitive types both as objects and as primitive types.

    Note that fastutil provides a corresponding abstract class that can be used to implement this interface just by specifying the type-specific comparator.

    See Also:
    Comparator
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      int compare​(char k1, char k2)
      Compares its two primitive-type arguments for order.
      default int compare​(java.lang.Character ok1, java.lang.Character ok2)
      Deprecated.
      Please use the corresponding type-specific method instead.
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Method Detail

      • compare

        int compare​(char k1,
                    char 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:
        Comparator
      • compare

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

        This implementation delegates to the corresponding type-specific method.

        Specified by:
        compare in interface java.util.Comparator<java.lang.Character>