oracle.ide.net
Class URLComparator
java.lang.Object
|
+--oracle.ide.net.URLComparator
- All Implemented Interfaces:
- java.util.Comparator
- public final class URLComparator
- extends java.lang.Object
- implements java.util.Comparator
The URLComparator
is an implementation of the Comparator
interface that can be used for ordering
URL
s. The ordering is performed based on the
Object.toString()
representations of the URL
s.
Constructor Summary |
URLComparator()
Creates a URLComparator that sorts URL s by
their string form in a case-sensitive way. |
URLComparator(boolean dirsBeforeFiles)
Creates a URLComparator that sorts URL s by
their string form using the case-sensitivity of the local file
system. |
URLComparator(boolean dirsBeforeFiles,
boolean caseSensitive)
Creates a URLComparator that sorts URL s by
their string form using the specified case-sensitivity. |
Method Summary |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
URLComparator
public URLComparator()
- Creates a
URLComparator
that sorts URL
s by
their string form in a case-sensitive way.
URLComparator
public URLComparator(boolean dirsBeforeFiles)
- Creates a
URLComparator
that sorts URL
s by
their string form using the case-sensitivity of the local file
system.
- Parameters:
dirsBeforeFiles
- If true
, the
URLComparator
will sort directories before files.
Otherwise, directories and files will be sorted together.
URLComparator
public URLComparator(boolean dirsBeforeFiles,
boolean caseSensitive)
- Creates a
URLComparator
that sorts URL
s by
their string form using the specified case-sensitivity.
- Parameters:
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 URL
s in a
case-sensitive way. Otherwise sorting is case-insensitive.
compare
public int compare(java.lang.Object o1,
java.lang.Object o2)
- Specified by:
compare
in interface java.util.Comparator