Top Description Fields Constructors Methods
sun.java2d.marlin

pack-priv final Class MergeSort

extends Object
Class Inheritance
Imports
java.util.Arrays

MergeSort adapted from (OpenJDK 8) java.util.Array.legacyMergeSort(Object[]) to swap two arrays at the same time (x & y) and use external auxiliary storage for temporary arrays

Field Summary

Modifier and TypeField and Description
private static final boolean
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final String
pack-priv static final boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
checkRange(int[] x, int lo, int hi)

private static void
mergeSort(final int[] refX, final int[] refY, final int[] srcX, final int[] dstX, final int[] srcY, final int[] dstY, final int low, final int high)

Src is the source array that starts at index 0 Dest is the (possibly larger) array destination with a possible offset low is the index in dest to start sorting high is the end index in dest to end sorting

pack-priv static void
mergeSortNoCopy(final int[] x, final int[] y, final int[] auxX, final int[] auxY, final int toIndex, final int insertionSortIndex, final boolean skipISort, final DPQSSorterContext sorter, final boolean useDPQS)

Modified merge sort: Input arrays are in both auxX/auxY (sorted: 0 to insertionSortIndex) and x/y (unsorted: insertionSortIndex to toIndex) Outputs are stored in x/y arrays

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CHECK_SORTEDback to summary
private static final boolean CHECK_SORTED
DISABLE_ISORT_THRESHOLDback to summary
pack-priv static final int DISABLE_ISORT_THRESHOLD
DPQS_THRESHOLDback to summary
pack-priv static final int DPQS_THRESHOLD
INSERTION_SORT_THRESHOLDback to summary
pack-priv static final int INSERTION_SORT_THRESHOLD
SORT_TYPEback to summary
pack-priv static final String SORT_TYPE
USE_DPQSback to summary
pack-priv static final boolean USE_DPQS

Constructor Detail

MergeSortback to summary
private MergeSort()

Method Detail

checkRangeback to summary
private static void checkRange(int[] x, int lo, int hi)
mergeSortback to summary
private static void mergeSort(final int[] refX, final int[] refY, final int[] srcX, final int[] dstX, final int[] srcY, final int[] dstY, final int low, final int high)

Src is the source array that starts at index 0 Dest is the (possibly larger) array destination with a possible offset low is the index in dest to start sorting high is the end index in dest to end sorting

mergeSortNoCopyback to summary
pack-priv static void mergeSortNoCopy(final int[] x, final int[] y, final int[] auxX, final int[] auxY, final int toIndex, final int insertionSortIndex, final boolean skipISort, final DPQSSorterContext sorter, final boolean useDPQS)

Modified merge sort: Input arrays are in both auxX/auxY (sorted: 0 to insertionSortIndex) and x/y (unsorted: insertionSortIndex to toIndex) Outputs are stored in x/y arrays