Class Employee.Employee
java.lang.Object
Employee.Employee
- All Implemented Interfaces:
Cloneable
The Employee.Employee class represents an individual employee and contains the Employee.Employee constructor used to add employees to the employeeData hashMap.
-
Constructor Summary
ConstructorsConstructorDescriptionEmployee.Employee
(String name, String position, int schedule, int section) Constructs a new Employee.Employee object with the specified name, position, schedule, and section. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone of the employee.getName()
Returns the first and last name of the employee.Returns the position of the employee.int
Returns the schedule of the employee.int
Returns the section of tables that the employee is responsible for.void
Sets the first and last name of the employee.void
setPosition
(String position) Sets the position of the employee.void
setSchedule
(int schedule) Sets the schedule of the employee.void
setSection
(int section) Sets the section of tables that the employee is responsible for.toString()
Returns a string representation of the employee in the format: "Name: [first and last name] | Position: [position] | Schedule: [schedule] | Section: [section]"
-
Constructor Details
-
Employee.Employee
Constructs a new Employee.Employee object with the specified name, position, schedule, and section.- Parameters:
name
- the first and last name of the employeeposition
- the position of the employeeschedule
- numerical value representing the schedule of the employeesection
- the section of tables that the employee is responsible for
-
-
Method Details
-
getName
Returns the first and last name of the employee.- Returns:
- the name of the employee
-
setName
Sets the first and last name of the employee.- Parameters:
name
- the new name of the employee
-
getPosition
Returns the position of the employee.- Returns:
- the position of the employee
-
setPosition
Sets the position of the employee.- Parameters:
position
- the new position of the employee
-
getSchedule
public int getSchedule()Returns the schedule of the employee.- Returns:
- the schedule of the employee as a numerical value (1, 2, or 3)
-
setSchedule
public void setSchedule(int schedule) Sets the schedule of the employee.- Parameters:
schedule
- the new schedule of the employee as a numerical value (1, 2, or 3)
-
getSection
public int getSection()Returns the section of tables that the employee is responsible for.- Returns:
- the section of tables the employee is responsible for
-
setSection
public void setSection(int section) Sets the section of tables that the employee is responsible for.- Parameters:
section
- the new section of tables the employee is responsible for
-
toString
Returns a string representation of the employee in the format: "Name: [first and last name] | Position: [position] | Schedule: [schedule] | Section: [section]" -
clone
Returns a clone of the employee.- Returns:
- a clone of the employee
-