public class ParallelSort extends Object
ParallelSort2
,
SlowParallelSort
Constructor and Description |
---|
ParallelSort() |
Modifier and Type | Method and Description |
---|---|
static <T> void |
sort(List<T> list,
Comparator<? super T> comparator,
int requestedNumThreads)
Sorts the specified list using the specified number of threads.
|
static <T extends Comparable<T>> |
sort(List<T> list,
int requestedNumThreads)
Sorts the specified list using the specified number of threads.
|
public static <T extends Comparable<T>> void sort(List<T> list, int requestedNumThreads)
T
- the type of element in the listlist
- the list to sortrequestedNumThreads
- the number of threads to useNullPointerException
- if any of the reference arguments are null or if the specified
list contains any null elementsIllegalArgumentException
- if the specified number of threads is zero or negativeRuntimeException
- if this thread is interrupted while waiting on parallel operations
to completepublic static <T> void sort(List<T> list, Comparator<? super T> comparator, int requestedNumThreads)
T
- the type of element in the listlist
- the list to sortcomparator
- the comparator to use for ordering items relative to one anotherrequestedNumThreads
- the number of threads to useNullPointerException
- if any of the reference arguments are null or if the specified
list contains any null elementsIllegalArgumentException
- if the specified number of threads is zero or negativeRuntimeException
- if this thread is interrupted while waiting on parallel operations
to complete