<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import java.io.*;
import java.util.*;

/**
 * A DirectoryComparator that uses the absolute path to determine
 * order
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class DirectoryNameComparator extends DirectoryComparator
{

    /**
     * Compare two File objects for order based on their
     * absolute path
     * 
     * @param  firstFile   The first File object
     * @param  secondFile  The second File object
     * @return             -1/0/1 for "less than"/"equal to"/"greater than"
     */
    public int compare(File firstFile, File secondFile)
    {
	int          comparison;
	String       firstName, secondName;


	firstName  = firstFile.getAbsolutePath();
	secondName = secondFile.getAbsolutePath();

	comparison = firstName.compareTo(secondName);

	return comparison;
    }
}
</pre></body></html>