public class SizeFileComparator extends Object implements Comparator<File>, Serializable
| 构造器和说明 |
|---|
SizeFileComparator() |
SizeFileComparator(boolean sumDirectoryContents)
Construct a file size comparator instance specifying whether the size of
the directory contents should be aggregated.
|
public SizeFileComparator()
public SizeFileComparator(boolean sumDirectoryContents)
If the sumDirectoryContents is true The size of
directories is calculated using Files.sizeOfDirectory(File).
sumDirectoryContents - true if the sum of the directories' contents
should be calculated, otherwise false if directories should be treated
as size zero (see Files.sizeOfDirectory(File)).public int compare(File file1, File file2)
compare 在接口中 Comparator<File>file1 - The first file to comparefile2 - The second file to compareCopyright © 2022. All rights reserved.