Interface FloatComparator
- All Superinterfaces:
Comparator<Float>
- All Known Implementing Classes:
FloatComparators.NaturalImplicitComparator,FloatComparators.OppositeComparator,FloatComparators.OppositeImplicitComparator,FloatComparators.TolerantComparator
A type-specific
Comparator; provides methods to compare two primitive
types both as objects and as primitive types.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintcompare(float k1, float k2) Compares its two primitive-type arguments for order.default intDeprecated.Please use the corresponding type-specific method instead.default FloatComparatorreversed()default FloatComparatorthenComparing(FloatComparator 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 Comparator<Float>thenComparing(Comparator<? super Float> second) Methods inherited from interface java.util.Comparator
equals, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Method Details
-
compare
int compare(float k1, float 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
- Specified by:
reversedin interfaceComparator<Float>
-
compare
Deprecated.Please use the corresponding type-specific method instead.This implementation delegates to the corresponding type-specific method.
- Specified by:
comparein interfaceComparator<Float>
-
thenComparing
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
- Specified by:
thenComparingin interfaceComparator<Float>
-