public final class CollectionUtil extends Object
Modifier and Type | Method and Description |
---|---|
static <T extends Comparable<? super T>> |
introSort(List<T> list)
Sorts the given random access
List in natural order. |
static <T> void |
introSort(List<T> list,
Comparator<? super T> comp)
Sorts the given random access
List using the Comparator . |
static <T extends Comparable<? super T>> |
timSort(List<T> list)
Sorts the given random access
List in natural order. |
static <T> void |
timSort(List<T> list,
Comparator<? super T> comp)
Sorts the given random access
List using the Comparator . |
public static <T> void introSort(List<T> list, Comparator<? super T> comp)
List
using the Comparator
.
The list must implement RandomAccess
. This method uses the intro sort
algorithm, but falls back to insertion sort for small lists.IllegalArgumentException
- if list is e.g. a linked list without random access.public static <T extends Comparable<? super T>> void introSort(List<T> list)
List
in natural order.
The list must implement RandomAccess
. This method uses the intro sort
algorithm, but falls back to insertion sort for small lists.IllegalArgumentException
- if list is e.g. a linked list without random access.public static <T> void timSort(List<T> list, Comparator<? super T> comp)
List
using the Comparator
.
The list must implement RandomAccess
. This method uses the Tim sort
algorithm, but falls back to binary sort for small lists.IllegalArgumentException
- if list is e.g. a linked list without random access.public static <T extends Comparable<? super T>> void timSort(List<T> list)
List
in natural order.
The list must implement RandomAccess
. This method uses the Tim sort
algorithm, but falls back to binary sort for small lists.IllegalArgumentException
- if list is e.g. a linked list without random access.Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.