You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
888 B

import java.util.ArrayList;
import java.util.List;
public class EmployeeSearch {
public List<Employee> findByDepartment(List<Employee> employees, String department) {
// Department field not defined in Employee; returning empty for now.
return new ArrayList<>();
}
public List<Employee> findByHireDateRange(List<Employee> employees, String startDate, String endDate) {
// Hire date field not defined in Employee; returning empty for now.
return new ArrayList<>();
}
public List<Employee> findBySalaryRange(List<Employee> employees, int minSalary, int maxSalary) {
List<Employee> result = new ArrayList<>();
for (Employee e : employees) {
int sal = e.getSalary();
if (sal >= minSalary && sal <= maxSalary) {
result.add(e);
}
}
return result;
}
}