public class DefaultSortSupporter<T extends Comparable<T>> extends Object implements SortSupporter<T>
| 构造器和说明 |
|---|
DefaultSortSupporter() |
| 限定符和类型 | 方法和说明 |
|---|---|
List<T> |
autoSort(Collection<T> nonNullList,
boolean asc)
自动选择排序实现,并进行排序
注: 在当前逻辑下, 由于其是调用forkJoinMergeSort或collectionsSort, 所以也是稳定的. |
List<T> |
collectionsSort(Collection<T> nonNullList,
boolean asc)
【稳定排序】Collections.sort快速or归并排序
|
List<T> |
forkJoinMergeSort(Collection<T> nonNullList,
boolean asc)
【稳定排序】多线程归并排序
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcustomizedSort, doSortpublic List<T> autoSort(Collection<T> nonNullList, boolean asc)
SortSupporterautoSort 在接口中 SortSupporter<T extends Comparable<T>>nonNullList - 非空集合(集合本身不为空, 集合里面的元素全都不为null)asc - true-与Comparable结果方向一致, false-与Comparable结果方向相反
public List<T> forkJoinMergeSort(Collection<T> nonNullList, boolean asc)
SortSupporterforkJoinMergeSort 在接口中 SortSupporter<T extends Comparable<T>>nonNullList - 非空集合(集合本身不为空, 集合里面的元素全都不为null)asc - true-与Comparable结果方向一致, false-与Comparable结果方向相反
public List<T> collectionsSort(Collection<T> nonNullList, boolean asc)
SortSupportercollectionsSort 在接口中 SortSupporter<T extends Comparable<T>>nonNullList - 非空集合(集合本身不为空, 集合里面的元素全都不为null)asc - true-与Comparable结果方向一致, false-与Comparable结果方向相反
Copyright © 2023. All rights reserved.