Shift
A Shift represents a duration of time during which an employee is scheduled to work. A shift is associated with a particular job skill which someone is required to have before they can work this shift. A shift can be filled by at most one employee.
Note to students: Suggested javadoc command options are:
-verbose -author -version -private -nohelp -nodeprecated
-linksource -windowtitle
Constructor Summary | |
Shift(Time startTime,
Time endTime)
Construct a shift from starting and ending times. |
Method Summary | |
int |
durationOf()
Determines how many hours are in this shift. |
Employee |
getEmployee()
Gets the employee who is assigned to work this shift. |
Skill |
getSkill()
Gets the skill associated with this shift. |
boolean |
isFilled()
Return whether or not this shift has been assigned an employee. |
void |
setEmployee(Employee person)
Assigns an employee to this shift. |
void |
setSkill(Skill aSkill)
Associates a job skill with this shift. |
Constructor Detail |
public Shift(Time startTime, Time endTime)
startTime
- the time this shift startsendtime
- the time this shift endsMethod Detail |
public int durationOf()
public Employee getEmployee()
public Skill getSkill()
public boolean isFilled()
true
if this shift is filled,
false
otherwise.public void setEmployee(Employee person) throws WrongSkillException
person
- the employee who is to work during this shiftWrongSkillException
- if the employee doesn't have
the skill needed for this shift.public void setSkill(Skill aSkill)
aSkill
- the skill that someone is required to have in order
to work this shift.