Package org.alfresco.solr
Class DualPivotQuickSort
java.lang.Object
org.alfresco.solr.DualPivotQuickSort
Implementation 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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidsort(T[] elements, int left, int right, Comparator<T> comparator) Sort elements between index left and index right, using comparator.static <T> voidsort(T[] elements, Comparator<T> comparator) Sort elements using comparator, in place.
-
Field Details
-
INSERTION_SORT_THRESHOLD
public static final int INSERTION_SORT_THRESHOLD- See Also:
-
DIST_SIZE
public static final int DIST_SIZE- See Also:
-
-
Constructor Details
-
DualPivotQuickSort
public DualPivotQuickSort()
-
-
Method Details
-
sort
Sort elements using comparator, in place. -
sort
Sort elements between index left and index right, using comparator.
-