import java.util.Comparator; public class KeyComp implements Comparator { public int compare(KeyType s1, KeyType s2) { return( s1.key.compareTo(s2.key) ); } public boolean equals(KeyType s1, KeyType s2) { return( s1.key.compareTo(s2.key) == 0 ); } }