class Employee extends Person implements java.io.Serializable
Constructor and Description |
---|
Employee(int id,
java.lang.String firstName,
java.lang.String lastName,
double salary,
int accountNumber)
This is the constructor for the Employee class.
|
Modifier and Type | Method and Description |
---|---|
(package private) int |
getAccountNumber() |
(package private) double |
getSalary() |
void |
setAccountNumber(int accountNumber)
Allows setting the employee's account number.
|
void |
setSalary(double salary)
Allows setting the employee's salary.
|
java.lang.String |
toString()
This method overrides toString to return a nicely formatted
string consisting of all the employee object's fields
|
static boolean |
validateAccountNumber(int accountNumber)
This method validates the account number.
|
static boolean |
validateSalary(double salary)
This method validates the salary figure, merely ensuring
the salary is not negative.
|
getFirstName, getID, getLastName, setFirstName, setLastName, validateName
public Employee(int id, java.lang.String firstName, java.lang.String lastName, double salary, int accountNumber)
id
- The UID for the new employeefirstName
- The first name for the new employeelastName
- The last name for the new employeesalary
- The monthly salary for the new employeeaccountNumber
- The direct deposit account number for the new employeepublic static boolean validateSalary(double salary)
salary
- The salary figure to validatepublic static boolean validateAccountNumber(int accountNumber)
accountNumber
- The employee account number to validate.int getAccountNumber()
public void setAccountNumber(int accountNumber)
accountNumber
- The new account numberdouble getSalary()
public void setSalary(double salary)
salary
- The new salary for the employee