- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStaffMember.java
More file actions
Latest commit
77 lines (63 loc) · 3.07 KB
/
Copy pathStaffMember.java
File metadata and controls
77 lines (63 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
******************************* My changes were***************************************************************************************
1. adding the STANDARD_VACATION constant for hold the base number of vaction days
2. added the abstract Vacaction method to be implemented by the volunteer, Employee, Hourly, and Executive classes
3. Took out the pay method and put it into the Payable interface, which is implemented by this class
4. over rode the compareTo method and thus implemented the Comparable interface
************************************************************Important***********************************************************************************
I Thomas Jessop only modifed this code and clam no ownership or credit for the orginal state of this program and only added documention to my edits
********************************************************************************************************************************************************
*@param STANDARD_VACATION constant for hold the base number of vaction days
**/
//********************************************************************
// StaffMember.java Author: Lewis/Loftus
//
// Represents a generic staff member.
//********************************************************************
abstractpublicclassStaffMemberimplementsPayable, Comparable<StaffMember>
{
protectedStringname;
protectedStringaddress;
protectedStringphone;
//STANDARD_VACATION constant for hold the base number of vaction days
protectedfinalintSTANDARD_VACATION = 14;
//-----------------------------------------------------------------
// Constructor: Sets up this staff member using the specified
// information.
//-----------------------------------------------------------------
publicStaffMember(StringeName, StringeAddress, StringePhone)
{
name = eName;
address = eAddress;
phone = ePhone;
}
//-----------------------------------------------------------------
// Returns a string including the basic employee information.
//-----------------------------------------------------------------
publicStringtoString()
{
Stringresult = "Name: " + name + "\n";
result += "Address: " + address + "\n";
result += "Phone: " + phone;
returnresult;
}
/**
* Vacaction method to be implemented by the Volunteer, Employee, Hourly, and Executive classes
* @return int
*/
publicabstractintvacation();
/**
* Compares staffmembers for sorting on the base of camparing their names
*
*@param nameC1 the name of this employee
*@param nameC2 the name of the employee that is being compared to the curent employee
*@param score intger used for holding the result of the string comparion of the employee names
*@return score
*/
publicintcompareTo(StaffMemberemp1){
StringnameC1 = this.name;
StringnameC2 = emp1.name;
intscore=nameC1.compareTo(nameC2);
returnscore;
}
}