public final class URLComparator
extends java.lang.Object
implements java.util.Comparator
URLComparator is an implementation of the Comparator interface that can be used for ordering
URLs. The ordering is performed based on the
Object.toString() representations of the URLs.| Constructor and Description |
|---|
URLComparator()
Creates a
URLComparator that sorts URLs by
their string form in a case-sensitive way. |
URLComparator(boolean dirsBeforeFiles)
Creates a
URLComparator that sorts URLs by
their string form using the case-sensitivity of the local file
system. |
URLComparator(boolean dirsBeforeFiles,
boolean caseSensitive)
Creates a
URLComparator that sorts URLs by
their string form using the specified case-sensitivity. |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(java.lang.Object o1,
java.lang.Object o2) |
public URLComparator()
URLComparator that sorts URLs by
their string form in a case-sensitive way.public URLComparator(boolean dirsBeforeFiles)
URLComparator that sorts URLs by
their string form using the case-sensitivity of the local file
system.dirsBeforeFiles - If true, the
URLComparator will sort directories before files.
Otherwise, directories and files will be sorted together.public URLComparator(boolean dirsBeforeFiles,
boolean caseSensitive)
URLComparator that sorts URLs by
their string form using the specified case-sensitivity.dirsBeforeFiles - If true, the
URLComparator will sort directories before files.
Otherwise, directories and files will be sorted together.caseSensitive - If true, the
URLComparator will sort URLs in a
case-sensitive way. Otherwise sorting is case-insensitive.