/** * 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
*
* @author John Dalbey
* @version 1.0 - June 07, 2001
*/
public class Shift implements Serializable
{
// -- DATA MEMBERS --
/**
* The time this shift is scheduled to begin.
*/
private Time startTime;
/**
* The time this shift ends.
*/
private Time endTime;
/**
* The kind of job skill someone must possess in order to be
* qualified to work during this shift.
*/
private Skill shiftSkill;
/**
* Who has been assigned to work during this shift.
*/
private Employee assignedEmployee;
/**
* Indicates whether or not anyone has been assigned to this shift.
*/
private boolean isFilled;
// -- METHODS --
/**
* Construct a shift from starting and ending times.
*
* @param startTime the time this shift starts
* @param endtime the time this shift ends
*/
public Shift(Time startTime, Time endTime)
{
}
/**
* Return whether or not this shift has been assigned an employee.
*
* @return true
if this shift is filled,
* false
otherwise.
*/
public boolean isFilled()
{
return isFilled;
}
/**
* Determines how many hours are in this shift.
*
* @return The number of hours in this shift, rounded up to the
* nearest integer.
* Pre: endtime >= starttime
*/
public int durationOf()
{
}
/**
* Associates a job skill with this shift.
*
* @param aSkill the skill that someone is required to have in order
* to work this shift.
*/
public void setSkill(Skill aSkill)
{
}
/**
* Gets the skill associated with this shift.
*
* @return the skill associated with this shift
*/
public Skill getSkill()
{
}
/**
* Assigns an employee to this shift.
*
* @param person the employee who is to work during this shift
* Pre: This shift has a skill associated with it.
* Post: This shift is filled.
* @throws WrongSkillException if the employee doesn't have
* the skill needed for this shift.
*/
public void setEmployee(Employee person) throws WrongSkillException
{
}
/**
* Gets the employee who is assigned to work this shift.
*
* @return the employee who is assigned to work this shift
*/
public Employee getEmployee()
{
}
}