|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Employees
Is a representation of any employee used throughout the employee scheduler. Each employee contains their own attributes including name, phone, availability, etc.
Field Summary | |
private Weeks |
availability
Availability of the employee |
private float |
desiredHours
Desired number of hours of work per week |
private java.lang.String |
email
E-Mail address of the employee |
private java.lang.String |
name
Name of the employee |
private java.lang.String |
phone
Phone number of the employee |
private Weeks |
scheduled
Hours that the employee has been scheduled for already |
private ListOfSkills |
skills
Skills of the employee |
Constructor Summary | |
Employees(java.lang.String initName,
java.lang.String initPhone,
java.lang.String initEmail,
float initDesiredHours,
Weeks initAvailability,
ListOfSkills initSkills)
Constructs a new employee with given data |
Method Summary | |
void |
AddAvailability(int day,
DayTimeRanges toAdd)
Adds to the employee's availability |
void |
AddScheduled(int day,
DayTimeRanges toAdd)
Adds already scheduled hours to the employee |
void |
AddSkill(Skills toAdd)
Adds a skill to the employee |
java.lang.Object |
clone()
Creates a copy of the current object |
Weeks |
GetAvailability()
Gets a copy of the availability of the employee |
float |
GetDesiredHours()
Gets the number of hours that the employee would like to work per week |
java.lang.String |
GetEmail()
Gets the employee's e-mail address |
java.lang.String |
GetName()
Gets the employee's name |
java.lang.String |
GetPhone()
Gets the employee's phone number |
Weeks |
GetScheduled()
Gets a copy of the scheduled hours of the employee in a week |
ListOfSkills |
GetSkills()
Gets a copy of the list of skills that the employee has learned |
void |
RemoveAvailability(Weeks toRemove)
Removes a whole week's worth of time ranges from an employee's availability |
void |
RemoveScheduled(Weeks toRemove)
Removes a scheduled time from the employee |
void |
RemoveSkill(Skills toRemove)
Removes a skill from the employee |
void |
SetDesiredHours(float newDesiredHours)
Changes the employee's desired number of hours to work per week |
void |
SetEmail(java.lang.String newEmail)
Changes the employee's e-mail address |
void |
SetName(java.lang.String newName)
Changes the employee's name |
void |
SetPhone(java.lang.String newPhone)
Changes the employee's phone number |
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.lang.String name
private java.lang.String phone
private java.lang.String email
private Weeks availability
private Weeks scheduled
private float desiredHours
private ListOfSkills skills
Constructor Detail |
public Employees(java.lang.String initName, java.lang.String initPhone, java.lang.String initEmail, float initDesiredHours, Weeks initAvailability, ListOfSkills initSkills)
Pre-conditions: none
Post-conditions: All private variables will be set to their corresponding passed-variable.
initName
- the employee's nameinitPhone
- the employee's phone numberinitEmail
- the employee's email addressinitDesiredHours
- the employee's desired work hours a weekinitAvailability
- availability of the employeeinitSkills
- skills that the new employee hasMethod Detail |
public java.lang.String GetName()
Pre-conditions: none
Post-conditions: Returns the name of the employee.
public java.lang.String GetPhone()
Pre-conditions: none
Post-conditions: Returns the phone number of the employee.
public java.lang.String GetEmail()
Pre-conditions: none
Post-conditions: Returns the e-mail address of the employee.
public float GetDesiredHours()
Pre-conditions: none
Post-conditions: Returns the employee's desired hours.
public ListOfSkills GetSkills()
Pre-conditions: none
Post-conditions: Returns a copy of the employee's list of skills.
public Weeks GetAvailability()
Pre-conditions: none
Post-conditions: Returns the availability of the employee.
public Weeks GetScheduled()
Pre-conditions: none
Post-conditions: Returns a copy of the employee's schedule hours.
public void AddSkill(Skills toAdd)
Pre-conditions: A variable of type Skills containing data must be passed.
Post-conditions: The passed variable is added to the private variable containing the list of skills.
toAdd
- the skill that the employee has either learned or for some other
reason needs added to his/her databasepublic void AddAvailability(int day, DayTimeRanges toAdd)
Pre-conditions: A valid day of the week in integer representation must be passed.
A variable of type DayTimeRanges must be passed and valid.
Post-conditions: The passed variable of type DayTimeRanges is added to the employee's availability for the indicated day.
day
- day to add availability to (1=Monday,...)toAdd
- the time range to add to the employee's availability;
if the employee is already available in any of the times in the range,
then no change will be made for those particular overlapping timespublic void AddScheduled(int day, DayTimeRanges toAdd)
Pre-conditions: A valid day of the week in integer representation must be passed.
A variable of type DayTimeRanges must be passed and valid.
Post-conditions: The passed variable of type DayTimeRanges is added to the employee's scheduled times for the indicated day.
day
- day to add already scheduled hours to (1=Monday,...)toAdd
- the time range to add to the employee's already scheduled
hours, it should never happen that these overlap since the employee should
never be scheduled twice in the same time periodpublic void RemoveSkill(Skills toRemove)
Pre-conditions: A valid variable of type Skills is passed.
Post-conditions: The passed skill is removed from the employees list of skills.
toRemove
- skill that should no longer be listed under
the employee's learned skillspublic void RemoveAvailability(Weeks toRemove)
Pre-conditions: A valid variable of type Weeks is passed.
Post-conditions: A week's worth of time ranges is removed from the private availability variable.
toRemove
- week that contains the time ranges to remove from
an employee's availability; any times overlaping between toRemove
and the employee's availability will be set to "unavailable"public void RemoveScheduled(Weeks toRemove)
Pre-conditions: A valid variable of type Weeks is passed.
Post-conditions: A week's worth of time ranges is removed from the private scheduled variable.
toRemove
- week that contains the time ranges to remove from
an employee's scheduled times; any times overlaping between toRemove
and the employee's scheduled times will be set to "unscheduled"public void SetName(java.lang.String newName)
Pre-conditions: A valid variable of type String is passed.
Post-conditions: The private name variable is set to the passed variable.
newName
- new value for the empolyee's namepublic void SetPhone(java.lang.String newPhone)
Pre-conditions: A valid variable of type String is passed.
Post-conditions: The private phone variable is set to the passed variable.
newPhone
- new value for the employee's phone numberpublic void SetEmail(java.lang.String newEmail)
Pre-conditions: A valid variable of type String is passed.
Post-conditions: The private email variable is set to the passed variable.
newEmail
- new value for the employee's e-mail addresspublic void SetDesiredHours(float newDesiredHours)
Pre-conditions: A valid variable of type float is passed.
Post-conditions: The private desiredHours variable is set to the passed variable.
newDesiredHours
- new value for the employee's desired
number of hours to work per weekpublic java.lang.Object clone()
Pre-conditions:
Post-conditions: A copy of the current employee object is returned.
clone
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |