Вы ничего не вызываете.
У него есть методы сортировки, которые являются частными для java.util
.Вы позволяете ему вызывать их, когда вызываете функцию Arrays.sort()
или что-то в этом роде.
Это ясно из комментария:
/*
* The next two methods (which are package private and static) constitute
* the entire API of this class. Each of these methods obeys the contract
* of the public method with the same signature in java.util.Arrays.
*/
static <T> void sort(T[] a, Comparator<? super T> c) {
sort(a, 0, a.length, c);
}
static <T> void sort(T[] a, int lo, int hi, Comparator<? super T> c) {
...
}
Судя по времени моего последнего комментария,это заняло менее 15 минут:
И результат:
C:\Documents and Settings\glowcoder\My Documents>java SortTest
Time for default: 4094ms
Time for timsort: 3813ms
C:\Documents and Settings\glowcoder\My Documents>