Package org.alfresco.solr
Class DualPivotQuickSort
- java.lang.Object
-
- org.alfresco.solr.DualPivotQuickSort
-
public class DualPivotQuickSort extends java.lang.ObjectImplementation of the Dual Pivot Quick Sort algorithm, based on the paper by Vladimir Yaroslavskiy, available at DualPivotQuicksort.pdf. This provides an in-place sorting mechanism, to allow the reuse of arrays containing a large number of objects, reducing the number of temporary object created by the Alfresco Solr indexing service.- Author:
- Alex Miller
-
-
Field Summary
Fields Modifier and Type Field Description static intDIST_SIZEstatic intINSERTION_SORT_THRESHOLD
-
Constructor Summary
Constructors Constructor Description DualPivotQuickSort()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> voidsort(T[] elements, int left, int right, java.util.Comparator<T> comparator)Sort elements between index left and index right, using comparator.static <T> voidsort(T[] elements, java.util.Comparator<T> comparator)Sort elements using comparator, in place.
-
-
-
Field Detail
-
INSERTION_SORT_THRESHOLD
public static final int INSERTION_SORT_THRESHOLD
- See Also:
- Constant Field Values
-
DIST_SIZE
public static final int DIST_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
sort
public static <T> void sort(T[] elements, java.util.Comparator<T> comparator)Sort elements using comparator, in place.
-
sort
public static <T> void sort(T[] elements, int left, int right, java.util.Comparator<T> comparator)Sort elements between index left and index right, using comparator.
-
-