From e0471114fa4f7275e14c71a11cb6778294cd2efb Mon Sep 17 00:00:00 2001 From: piobkljxg <1573729895@qq.com> Date: Sun, 26 Oct 2025 21:06:51 +0800 Subject: [PATCH] ADD file via upload --- EmployeeSearch.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 EmployeeSearch.java diff --git a/EmployeeSearch.java b/EmployeeSearch.java new file mode 100644 index 0000000..04c5c5f --- /dev/null +++ b/EmployeeSearch.java @@ -0,0 +1,26 @@ +import java.util.ArrayList; +import java.util.List; + +public class EmployeeSearch { + + public List findByDepartment(List employees, String department) { + // Department field not defined in Employee; returning empty for now. + return new ArrayList<>(); + } + + public List findByHireDateRange(List employees, String startDate, String endDate) { + // Hire date field not defined in Employee; returning empty for now. + return new ArrayList<>(); + } + + public List findBySalaryRange(List employees, int minSalary, int maxSalary) { + List result = new ArrayList<>(); + for (Employee e : employees) { + int sal = e.getSalary(); + if (sal >= minSalary && sal <= maxSalary) { + result.add(e); + } + } + return result; + } +} \ No newline at end of file