|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Employee
An Employee contains information about an employee that would be important to a payroll application, such as wage and hours worked per week.
Constructor Summary | |
Employee(String name,
int id)
Constructor that assumes a $5.75 wage and 40 hours/week. |
|
Employee(String name,
int id,
int hoursWorked,
double payPerHour)
Constructor. |
Method Summary | |
boolean |
equals(Employee otherEmployee)
Returns true if two employees have the same name and ID and false otherwise. |
boolean |
equals(int otherID)
Returns true if the given int is equal to this employee's ID; otherwise returns false. |
boolean |
equals(String otherName)
Returns true if the given String is equal to this employee's name. |
int |
getHoursWorked()
Returns the number of hours worked |
int |
getID()
Returns this Employee's ID number |
String |
getName()
Returns this Employee's name. |
double |
getPayPerHour()
Returns this employee's hourly wage. |
double |
getWeeklyPay()
Returns weekly pay, which is hours worked * pay per hour. |
void |
setHoursWorked(int newHoursWorked)
Updates hours worked by this Employee. |
void |
setID(int newID)
Updates this Employee's ID number. |
void |
setName(String newName)
Updates this Employee's name. |
void |
setPayPerHour(double newPayPerHour)
Updates this employee's hourly pay. |
String |
toString()
Returns a String version of this Employee. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public Employee(String name, int id)
public Employee(String name, int id, int hoursWorked, double payPerHour)
Method Detail |
public String getName()
public void setName(String newName)
newName
- a String containing the employee's namepublic int getID()
public void setID(int newID)
newID
- an int to serve as the new ID for this employeepublic int getHoursWorked()
public void setHoursWorked(int newHoursWorked)
newHoursWorked
- a count of hours workedpublic double getPayPerHour()
public void setPayPerHour(double newPayPerHour)
newPayPerHour
- the new wage for this employeepublic double getWeeklyPay()
public boolean equals(Employee otherEmployee)
otherEmployee
- employee to compare with this onepublic boolean equals(String otherName)
public boolean equals(int otherID)
public String toString()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |