// Project: EmployeeFind // No additional modules defined // Source code file: Employee.java. // Show how to search collection for a specified substring. public class Employee implements Comparable{ private String id; private String name; private char gender; private int age; private double salary; public Employee(String theId, String theName, char theGender, int theAge, double theSalary) { id = theId; name = theName; gender = theGender; age = theAge; salary = theSalary; } // Getters. Only age has a setter. public String getId() { return id; } public String getName() { return name; } public char getGender() { return gender; } public int getAge() { return age; } public void setAge(int theAge) { age = theAge; } public double getSalary() { return salary; } @Override public String toString() { return String.format("Employee: %s %s %.2f", id, name, salary); } public int compareTo(Employee other) { return this.getName( ).compareTo(other.getName( )); } }