<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 partial implementation of the Comparator interface
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public abstract class DirectoryComparator implements Comparator
{


    /**
     * Compare two File objects for order
     * 
     * @param  firstFile   The first File object
     * @param  secondFile  The second File object
     * @return             -1/0/1 for "less than"/"equal to"/"greater than"
     */
    protected abstract int compare(File firstFile, File secondFile);



    /**
     * Compares two objects for order (required by Comparator)
     *
     * @param  firstObject   The first object
     * @param  secondObject  The second object
     * @return               -1/0/1 for "less than"/"equal to"/"greater than"
     */
    public int compare(Object firstObject, Object secondObject)
    {
	File      firstFile, secondFile;

	firstFile  = (File)firstObject;
	secondFile = (File)secondObject;

	return compare(firstFile, secondFile);
    }

}
</pre></body></html>