Package net.algart.arrays
Interface ArrayComparator32
- All Superinterfaces:
ArrayComparator
- All Known Implementing Classes:
JArrays.ByteArrayComparator
,JArrays.CharArrayComparator
,JArrays.DoubleArrayComparator
,JArrays.FloatArrayComparator
,JArrays.IntArrayComparator
,JArrays.LongArrayComparator
,JArrays.ShortArrayComparator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Version of ArrayComparator
for a case of 32-bit indexes (int instead of long).
- Author:
- Daniel Alievsky
-
Method Summary
Modifier and TypeMethodDescriptionboolean
less
(int first, int second) Should return true if, and only if, the element at position first in the sorted array is "less" than the element at position second.default boolean
less
(long first, long second) This method, implemented in this interface, just calls another less method with int indexes:
-
Method Details
-
less
default boolean less(long first, long second) This method, implemented in this interface, just calls another less method with int indexes:less
((int) first, (int) second);- Specified by:
less
in interfaceArrayComparator
- Parameters:
first
- index of the first compared element.second
- index of the second compared element.- Returns:
- true if, and only if, the element #first is "less" than the element #second.
-
less
boolean less(int first, int second) Should return true if, and only if, the element at position first in the sorted array is "less" than the element at position second. ("Less" element will have less index in the sorted array.) The result of this comparison must be fully defined by the values of the elements of the sorted array.- Parameters:
first
- index of the first compared element.second
- index of the second compared element.- Returns:
- true if, and only if, the element #first is "less" than the element #second.
-