Top Description Fields Constructors Methods
com.sun.javafx.collections

public Class SortHelper

extends Object
Class Inheritance
Imports
java.lang.reflect.Array, java.util.Arrays, .Comparator, .List, .ListIterator

A helper class containing algorithms taken from JDK 6 that additionally track the permutations that're created during the process.
See Also
Arrays

Field Summary

Modifier and TypeField and Description
private static final int
private int[]
private int[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static int[]
copyOfRange(int[] original, int from, int to)

private static <T> T[]
copyOfRange(T[] original, int from, int to)

private static <T, U> T[]
copyOfRange(U[] original, int from, int to, Class<? extends T[]> newType)

private int[]
initPermutation(int length)

private void
mergeSort(int[] src, int[] dest, int low, int high, int off)

private <T> void
mergeSort(T[] src, T[] dest, int low, int high, int off, Comparator<? super T> comparator)

private static void
rangeCheck(int arrayLen, int fromIndex, int toIndex)

public <T> int[]
sort(List<T> list, Comparator<? super T> comparator)

private <T> int[]
sort(T[] items, Comparator<? super T> comparator)

public <T> int[]
sort(T[] items, int fromIndex, int toIndex, Comparator<? super T> comparator)

public int[]
sort(int[] indices, int fromIndex, int toIndex)

private void
swap(int[] x, int a, int b)

private void
swap(Object[] x, int a, int b)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSERTIONSORT_THRESHOLDback to summary
private static final int INSERTIONSORT_THRESHOLD
permutationback to summary
private int[] permutation
reversePermutationback to summary
private int[] reversePermutation

Constructor Detail

SortHelperback to summary
public SortHelper()

Method Detail

copyOfRangeback to summary
private static int[] copyOfRange(int[] original, int from, int to)
copyOfRangeback to summary
private static <T> T[] copyOfRange(T[] original, int from, int to)
copyOfRangeback to summary
private static <T, U> T[] copyOfRange(U[] original, int from, int to, Class<? extends T[]> newType)
initPermutationback to summary
private int[] initPermutation(int length)
mergeSortback to summary
private void mergeSort(int[] src, int[] dest, int low, int high, int off)
mergeSortback to summary
private <T> void mergeSort(T[] src, T[] dest, int low, int high, int off, Comparator<? super T> comparator)
rangeCheckback to summary
private static void rangeCheck(int arrayLen, int fromIndex, int toIndex)
sortback to summary
public <T> int[] sort(List<T> list, Comparator<? super T> comparator)
sortback to summary
private <T> int[] sort(T[] items, Comparator<? super T> comparator)
sortback to summary
public <T> int[] sort(T[] items, int fromIndex, int toIndex, Comparator<? super T> comparator)
sortback to summary
public int[] sort(int[] indices, int fromIndex, int toIndex)
swapback to summary
private void swap(int[] x, int a, int b)
swapback to summary
private void swap(Object[] x, int a, int b)