I was given the code below as Homework. I am being asked to implement comparator for employee objects. The compare method returns an int. However, none of the methods that I have in my employee class return an int if you compare them. Can anyone give me some guidance on how the compare method is supposed to work? Thank you
import java.util.*;
import java.io.*;
public class EmployeeClient
{
//A Comparator for Employees
// Primary key : Employee category - Salaried > Weekly > Daily
// Secondary key : Employee gross pay
private static class EmployeeComparator implements Comparator
{
public int compare(Object one, Object two)
{
Employee uno = (Employee) one;
Employee dos = (Employee) two;
}
}
public abstract class Employee {
private String idNumber;
private double payRate;
//Accessor: Return the id number of employee
public String getidNumber()
{
return idNumber;
}
//Accessor: Return the payrate of the employee
public double getpayRate()
{
return payRate;
}
public String toString()
{
return getidNumber()+" "+getpayRate();
}
public abstract double grossPay();
}