mckay.utilities.vectorsorter
Interface QuicksortComparator


public interface QuicksortComparator

An interface intended to be implemented for use with the SortableVector Quicksort implementation. A class that implements this interface will perform the coparisons that are made during the sorting process.

This approach to the Quicksort algorithm is derived from Bruce Eckel's implementation, which can be found at: http://www.codeguru.com/java/tij/tij0091.shtml


Method Summary
 int compare(java.lang.Object first, java.lang.Object second)
          Tests two objects to see whether the are "equal" and, if not, which is "greater" than the other (in whatever sense is relevant).
 

Method Detail

compare

int compare(java.lang.Object first,
            java.lang.Object second)
Tests two objects to see whether the are "equal" and, if not, which is "greater" than the other (in whatever sense is relevant).

Parameters:
first - The object to compare to second.
second - The object to compare to first.
Returns:
0 if first and second are equal, a negative integer if first is less than second or a positive integer if first is greater than second.