Package com.complexible.common.base
Class Sorter.QuickSorter<T>
- java.lang.Object
-
- com.complexible.common.base.Sorter<T>
-
- com.complexible.common.base.Sorter.QuickSorter<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.complexible.common.base.Sorter
Sorter.QuickSorter<T>
-
-
Constructor Summary
Constructors Constructor Description QuickSorter(java.util.Comparator<? super T> c)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends java.lang.Comparable<? super T>>
voidquickSort(T[] array, int start, int end)Sort the specified range of an array of object that implement the Comparable interface.static <T> voidquickSort(T[] array, int start, int end, java.util.Comparator<T> comp)Sorts the specified range in the array in a specified order.voidsort(T[] array, int start, int end)
-
-
-
Constructor Detail
-
QuickSorter
public QuickSorter(java.util.Comparator<? super T> c)
-
-
Method Detail
-
quickSort
public static <T> void quickSort(T[] array, int start, int end, java.util.Comparator<T> comp)Sorts the specified range in the array in a specified order.- Parameters:
array- the array to be sorted.start- the start index to sort.end- the last + 1 index to sort.comp- the comparator.- Throws:
java.lang.IllegalArgumentException- ifstart > end.java.lang.ArrayIndexOutOfBoundsException- ifstart < 0orend > array.length.
-
quickSort
public static <T extends java.lang.Comparable<? super T>> void quickSort(T[] array, int start, int end)Sort the specified range of an array of object that implement the Comparable interface.- Type Parameters:
T- The type of object.- Parameters:
array- the array.start- the first index.end- the last index (exclusive).
-
-