de.matthiasmann.twl
Class FileSelector.NameSorter

java.lang.Object
  extended by de.matthiasmann.twl.FileSelector.NameSorter
All Implemented Interfaces:
java.util.Comparator<java.lang.Object>
Enclosing class:
FileSelector

public static class FileSelector.NameSorter
extends java.lang.Object
implements java.util.Comparator<java.lang.Object>

A file object comparator which delegates to a String comprataor to sort based on the name of the file objects.


Constructor Summary
FileSelector.NameSorter(FileSystemModel fsm)
          Creates a new comparator which uses NaturalSortComparator.stringComparator to sort the names
FileSelector.NameSorter(FileSystemModel fsm, java.util.Comparator<java.lang.String> nameComparator)
          Creates a new comparator which uses the specified String comparator to sort the names
 
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
 

Constructor Detail

FileSelector.NameSorter

public FileSelector.NameSorter(FileSystemModel fsm)
Creates a new comparator which uses NaturalSortComparator.stringComparator to sort the names

Parameters:
fsm - the file system model

FileSelector.NameSorter

public FileSelector.NameSorter(FileSystemModel fsm,
                               java.util.Comparator<java.lang.String> nameComparator)
Creates a new comparator which uses the specified String comparator to sort the names

Parameters:
fsm - the file system model
nameComparator - the name comparator
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator<java.lang.Object>