cern.colt.GenericSorting Java Examples

The following examples show how to use cern.colt.GenericSorting. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChunkMergeSortHelper.java    From database with GNU General Public License v2.0 6 votes vote down vote up
/**
 * In place merge sort.
 * 
 * @param <E>
 *            The generic type of the elements in the chunk.
 * @param chunk
 *            The chunk.
 */
public static <E> void mergeSort(final E[] chunk) {

    if (chunk == null)
        throw new IllegalArgumentException();

    if (chunk.length == 0)
        return;

    GenericSorting.mergeSort(
            0, // fromIndex
            chunk.length, // toIndex
            new MyIntComparator((Comparable[]) chunk),
            new MySwapper((Object[]) chunk));
    
    return;

}