Package it.unimi.dsi.fastutil.booleans
Interface BooleanComparator
-
- All Superinterfaces:
java.util.Comparator<java.lang.Boolean>
- 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 BooleanComparator extends java.util.Comparator<java.lang.Boolean>
A type-specificComparator
; 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(boolean k1, boolean k2)
Compares its two primitive-type arguments for order.default int
compare(java.lang.Boolean ok1, java.lang.Boolean ok2)
Deprecated.Please use the corresponding type-specific method instead.default BooleanComparator
reversed()
default BooleanComparator
thenComparing(BooleanComparator second)
Return a new comparator that first uses this comparator, then uses the second comparator if this comparator compared the two elements as equal.default java.util.Comparator<java.lang.Boolean>
thenComparing(java.util.Comparator<? super java.lang.Boolean> second)
-
-
-
Method Detail
-
compare
int compare(boolean k1, boolean 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
-
reversed
default BooleanComparator reversed()
- Specified by:
reversed
in interfacejava.util.Comparator<java.lang.Boolean>
-
compare
@Deprecated default int compare(java.lang.Boolean ok1, java.lang.Boolean ok2)
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
compare
in interfacejava.util.Comparator<java.lang.Boolean>
- Implementation Specification:
- This implementation delegates to the corresponding type-specific method.
-
thenComparing
default BooleanComparator thenComparing(BooleanComparator 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:
Comparator.thenComparing(Comparator)
-
thenComparing
default java.util.Comparator<java.lang.Boolean> thenComparing(java.util.Comparator<? super java.lang.Boolean> second)
- Specified by:
thenComparing
in interfacejava.util.Comparator<java.lang.Boolean>
-
-