|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.util.io.FileNameComparator
public class FileNameComparator
FileNameComparator implements a Comparator class that compares file names (expressed either as String or File objects) for sorting. The comparison can be case-sensitive or case-insensitive, and can apply to the entire path (if available) or just the file name part.
| Constructor Summary | |
|---|---|
FileNameComparator()
Construct a new FileNameComparator with the default settings. |
|
FileNameComparator(boolean foldCase,
boolean entirePath)
Construct a new FileNameComparator. |
|
| Method Summary | |
|---|---|
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares its two arguments for order. |
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this Comparator. |
int |
hashCode()
Get the hash code for this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileNameComparator()
Comparator cmp = new FileNameComparator (false, false);
public FileNameComparator(boolean foldCase,
boolean entirePath)
foldCase - true for case-insensitive comparison,
false for case-sensitive comparisonentirePath - true to compare the entire path (where
available, false to use just the name.| Method Detail |
|---|
public int compare(java.lang.Object o1,
java.lang.Object o2)
compare in interface java.util.Comparator<java.lang.Object>o1 - the first object to be comparedo2 - the second object to be compared
public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" this Comparator.
equals in interface java.util.Comparator<java.lang.Object>equals in class java.lang.Objecto - the object to compare
public int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||