Package net.algart.arrays
Interface ArrayExchanger32
- All Superinterfaces:
ArrayExchanger
- All Known Implementing Classes:
JArrays.ByteAndIndexArrayExchanger,JArrays.ByteArrayExchanger,JArrays.CharAndIndexArrayExchanger,JArrays.CharArrayExchanger,JArrays.DoubleAndIndexArrayExchanger,JArrays.DoubleArrayExchanger,JArrays.FloatAndIndexArrayExchanger,JArrays.FloatArrayExchanger,JArrays.IntAndIndexArrayExchanger,JArrays.IntArrayExchanger,JArrays.LongAndIndexArrayExchanger,JArrays.LongArrayExchanger,JArrays.ShortAndIndexArrayExchanger,JArrays.ShortArrayExchanger
- 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 ArrayExchanger for a case of 32-bit indexes (int instead of long).
- Author:
- Daniel Alievsky
-
Method Summary
-
Method Details
-
swap
default void swap(long first, long second) This method, implemented in this interface, just calls another swap method with int indexes:Note: for maximal performance, it does not check that the passed intexes are really 32-bit. While using with arrays, containing 231 elements or more, this comparator will work incorrecly.swap((int) first, (int) second);- Specified by:
swapin interfaceArrayExchanger- Parameters:
first- index of the first exchanged element.second- index of the second exchanged element.
-
swap
void swap(int first, int second) Should exchange the elements at position first and second in the data array.- Parameters:
first- index of the first exchanged element.second- index of the second exchanged element.
-