# Class SortUtils

java.lang.Object
uk.ac.starlink.ttools.gpl.SortUtils

public class SortUtils extends Object
Utilities for sorting.

Since:
  3 Mar 2025
Author:
  Mark Taylor

## Method Summary

Modifier and Type
Method
Description
`static void`
`intSort(int[] array, IntComparator cmp)`
Serial sort of an integer array with a custom comparator.
`static void`
`parallelIntSort(int[] array, Supplier<? extends IntComparator> cmpSupplier)`
Parallel sort of an integer array with a custom, possibly non-thread-safe, comparator.
`static void`
`parallelIntSort(int[] array, IntComparator cmp)`
Parallel sort of an integer array with a custom comparator.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### intSort

public static void intSort(int[] array, IntComparator cmp)
Serial sort of an integer array with a custom comparator.

Parameters:
  `array` - array to sort
  `cmp` - comparator

### parallelIntSort

public static void parallelIntSort(int[] array, IntComparator cmp)
Parallel sort of an integer array with a custom comparator.

Parameters:
  `array` - array to sort
  `cmp` - comparator

### parallelIntSort

public static void parallelIntSort(int[] array, Supplier<? extends IntComparator> cmpSupplier)
Parallel sort of an integer array with a custom, possibly non-thread-safe, comparator. Any comparator obtained from the supplied factory will only be used within a single thread.

Parameters:
  `array` - array to sort
  `cmpSupplier` - supplier for comparators