Home | History | Annotate | Download | only in comparator

Lines Matching refs:File

3  * contributor license agreements.  See the NOTICE file distributed with

5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
19 import java.io.File;
27 * Compare the file name <b>extensions</b> for order
31 * by their file extension either in a case-sensitive, case-insensitive or
36 * Example of a <i>case-sensitive</i> file extension sort using the
39 * List&lt;File&gt; list = ...
43 * Example of a <i>reverse case-insensitive</i> file extension sort using the
46 * File[] array = ...
54 public class ExtensionFileComparator implements Comparator<File>, Serializable {
57 public static final Comparator<File> EXTENSION_COMPARATOR = new ExtensionFileComparator();
60 public static final Comparator<File> EXTENSION_REVERSE = new ReverseComparator<File>(EXTENSION_COMPARATOR);
63 public static final Comparator<File> EXTENSION_INSENSITIVE_COMPARATOR = new ExtensionFileComparator(IOCase.INSENSITIVE);
66 public static final Comparator<File> EXTENSION_INSENSITIVE_REVERSE
67 = new ReverseComparator<File>(EXTENSION_INSENSITIVE_COMPARATOR);
70 public static final Comparator<File> EXTENSION_SYSTEM_COMPARATOR = new ExtensionFileComparator(IOCase.SYSTEM);
73 public static final Comparator<File> EXTENSION_SYSTEM_REVERSE = new ReverseComparator<File>(EXTENSION_SYSTEM_COMPARATOR);
79 * Construct a case sensitive file extension comparator instance.
86 * Construct a file extension comparator instance with the specified case-sensitivity.
97 * @param obj1 The first file to compare
98 * @param obj2 The second file to compare
99 * @return a negative value if the first file's extension
102 * is greater than the second file.
105 public int compare(File file1, File file2) {