com.alee.utils.file
Class FileComparator

java.lang.Object
  extended by com.alee.utils.file.FileComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator<java.io.File>

public class FileComparator
extends java.lang.Object
implements java.util.Comparator<java.io.File>, java.io.Serializable

File name and type comparator. This comparator is used by some file components by default.

Author:
Mikle Garin
See Also:
Serialized Form

Constructor Summary
FileComparator()
           
 
Method Summary
 int compare(java.io.File f1, java.io.File f2)
          Compares two files by their names and type.
 
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
 

Constructor Detail

FileComparator

public FileComparator()
Method Detail

compare

public int compare(java.io.File f1,
                   java.io.File f2)
Compares two files by their names and type.

Specified by:
compare in interface java.util.Comparator<java.io.File>
Parameters:
f1 - first file to be compared
f2 - second file to be compared
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second