类 ComparatorUtils
java.lang.Object
dev.utils.common.comparator.ComparatorUtils
detail: 排序比较器工具类
- 作者:
- Ttt
使用以下方法要求 List 中不能存在 null 数据sort(List, Comparator)sortAsc(List)sortDesc(List)视情况可用以下方法清空 null 数据CollectionUtils.clearNull(Collection)File 排序可直接使用以下方法获取 ListFileUtils.listOrEmpty(File)FileUtils.listFilesOrEmpty(File)
-
方法概要
修饰符和类型方法说明static booleanList 反转处理static <T> booleansort(List<T> list, Comparator<? super T> comparator) List 排序处理static <T extends Comparable<? super T>>
booleanList 升序处理static <T extends DateSort>
booleansortDateAsc(List<T> list) Date 升序排序static <T extends DateSort>
booleansortDateDesc(List<T> list) Date 降序排序static <T> booleanList 降序处理static <T extends DoubleSort>
booleansortDoubleAsc(List<T> list) Double 升序排序static <T extends DoubleSort>
booleansortDoubleDesc(List<T> list) Double 降序排序static <T extends File>
booleansortFileAsc(List<T> list) 文件升序排序static <T extends File>
booleansortFileDesc(List<T> list) 文件降序排序static <T extends File>
booleansortFileLastModifiedAsc(List<T> list) 文件修改时间升序排序static <T extends File>
booleansortFileLastModifiedDesc(List<T> list) 文件修改时间降序排序static <T extends File>
booleansortFileLengthAsc(List<T> list) 文件大小升序排序static <T extends File>
booleansortFileLengthDesc(List<T> list) 文件大小降序排序static <T extends File>
booleansortFileNameAsc(List<T> list) 文件名升序排序static <T extends File>
booleansortFileNameDesc(List<T> list) 文件名降序排序static <T extends FloatSort>
booleansortFloatAsc(List<T> list) Float 升序排序static <T extends FloatSort>
booleansortFloatDesc(List<T> list) Float 降序排序static <T extends IntSort>
booleansortIntAsc(List<T> list) Int 升序排序static <T extends IntSort>
booleansortIntDesc(List<T> list) Int 降序排序static <T extends LongSort>
booleansortLongAsc(List<T> list) Long 升序排序static <T extends LongSort>
booleansortLongDesc(List<T> list) Long 降序排序static <T extends StringSort>
booleansortStringAsc(List<T> list) String 升序排序static <T extends StringSort>
booleansortStringDesc(List<T> list) String 降序排序static <T extends StringSort>
booleansortStringWindowsSimple2Asc(List<T> list) String Windows 排序比较器简单实现升序排序 ( 实现方式二 )static <T extends StringSort>
booleansortStringWindowsSimple2Desc(List<T> list) String Windows 排序比较器简单实现降序排序 ( 实现方式二 )static <T extends StringSort>
booleansortStringWindowsSimpleAsc(List<T> list) String Windows 排序比较器简单实现升序排序static <T extends StringSort>
booleansortStringWindowsSimpleDesc(List<T> list) String Windows 排序比较器简单实现降序排序static booleanWindows 目录资源文件升序排序 ( 实现方式二 )static booleanWindows 目录资源文件降序排序 ( 实现方式二 )static booleanWindows 目录资源文件升序排序static booleanWindows 目录资源文件降序排序static booleanWindows 目录资源文件名升序排序 ( 实现方式二 )static booleanWindows 目录资源文件名降序排序 ( 实现方式二 )static booleanWindows 目录资源文件名升序排序static booleanWindows 目录资源文件名降序排序
-
方法详细资料
-
reverse
List 反转处理- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sort
List 排序处理- 类型参数:
T- 泛型- 参数:
list- 集合comparator- 排序比较器- 返回:
truesuccess,falsefail
-
sortAsc
List 升序处理- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortDesc
List 降序处理- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortFileLastModifiedAsc
文件修改时间升序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortFileLastModifiedDesc
文件修改时间降序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortFileLengthAsc
文件大小升序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortFileLengthDesc
文件大小降序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortFileNameAsc
文件名升序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortFileNameDesc
文件名降序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortFileAsc
文件升序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortFileDesc
文件降序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortDateAsc
Date 升序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortDateDesc
Date 降序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortDoubleAsc
Double 升序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortDoubleDesc
Double 降序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortFloatAsc
Float 升序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortFloatDesc
Float 降序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortIntAsc
Int 升序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortIntDesc
Int 降序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortLongAsc
Long 升序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortLongDesc
Long 降序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortStringAsc
String 升序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortStringDesc
String 降序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortStringWindowsSimpleAsc
String Windows 排序比较器简单实现升序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortStringWindowsSimpleDesc
String Windows 排序比较器简单实现降序排序- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortStringWindowsSimple2Asc
String Windows 排序比较器简单实现升序排序 ( 实现方式二 )- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortStringWindowsSimple2Desc
String Windows 排序比较器简单实现降序排序 ( 实现方式二 )- 类型参数:
T- 泛型- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortWindowsExplorerFileSimpleComparatorAsc
Windows 目录资源文件升序排序- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortWindowsExplorerFileSimpleComparatorDesc
Windows 目录资源文件降序排序- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortWindowsExplorerFileSimpleComparator2Asc
Windows 目录资源文件升序排序 ( 实现方式二 )- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortWindowsExplorerFileSimpleComparator2Desc
Windows 目录资源文件降序排序 ( 实现方式二 )- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortWindowsExplorerStringSimpleComparatorAsc
Windows 目录资源文件名升序排序- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortWindowsExplorerStringSimpleComparatorDesc
Windows 目录资源文件名降序排序- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortWindowsExplorerStringSimpleComparator2Asc
Windows 目录资源文件名升序排序 ( 实现方式二 )- 参数:
list- 集合- 返回:
truesuccess,falsefail
-
sortWindowsExplorerStringSimpleComparator2Desc
Windows 目录资源文件名降序排序 ( 实现方式二 )- 参数:
list- 集合- 返回:
truesuccess,falsefail
-