|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Templates
A template contains all of the information for a single day of the schedule, templates may either be loaded from a file or created new
Field Summary | |
private java.util.Vector |
shifts
A Vector of shifts for the entire day (templates cover the whole day) |
Constructor Summary | |
Templates()
Constructs an empty template |
|
Templates(java.lang.String fileName)
Constructs a template from a given file |
Method Summary | |
void |
AddShift(Shifts toAdd)
Adds a shift to a template |
void |
ChangeEmployee(Shifts toChange,
Employees newEmployee)
Change the employee associated with a shift |
void |
ChangeSkill(Shifts toChange,
Skills newSkill)
Change a skill associated with a shift |
void |
ChangeTime(Shifts toChange,
DayTimeRanges newTime)
Change the time associated with a shift |
void |
Clear()
Clears the entire template |
java.util.Vector |
GetEmployeeShifts(Employees toGet)
Get the shifts assigned to a particular employee |
java.util.Vector |
GetShifts()
Gets all of the shifts in a template |
void |
RemoveShift(Shifts toRemove)
Removes a shift from a template |
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.util.Vector shifts
Constructor Detail |
public Templates()
Preconditions:
(none)
Postconditions:
An empty template (with no shifts) will be created
public Templates(java.lang.String fileName)
Preconditions:
The given fileName exists and is in the proper
format for a template file
Postconditions:
All of the information in the file with given
fileName will be loaded into the template
as specified in the file format guidlines
fileName
- name of the file with the template informationMethod Detail |
public void AddShift(Shifts toAdd)
Preconditions:
(none)
Postconditions:
Given shift toAdd will be added to the template
toAdd
- the shift to add to the templatepublic void RemoveShift(Shifts toRemove)
Preconditions:
(none)
Postconditions:
if there exists a shift within the template that matches
the same time and skill specified in the shift
toRemove, then that shift will be removed
from the template (if there are 2 matches, then
only one will be removed)
toRemove
- the shift to remove from the templatepublic void Clear()
Preconditions:
(none)
Postconditions:
Template will be empty (will contain no shifts)
public void ChangeSkill(Shifts toChange, Skills newSkill)
Preconditions:
(none)
Postconditions:
if there exists a shift within the template that matches
the same time and skill specified in the shift
toChange, then that shift will be changed
to accomidate the newSkill (if there are more
than one match, then only one will be changed
toChange
- the shift that is being changednewSkill
- the new skill to associate with the shiftpublic void ChangeTime(Shifts toChange, DayTimeRanges newTime)
Preconditions:
(none)
Postconditions:
if there exists a shift within the template that matches
the same time and skill specified in the shift
toChange, then that shift will be changed
to accomidate the newTime (if there are more
than one match, then only one will be changed)
toChange
- the shift that is being changednewTime
- the new time to associate with the shiftpublic void ChangeEmployee(Shifts toChange, Employees newEmployee)
Preconditions:
(none)
Postconditions:
if there exists a shift within the template that matches
the same time and skill specified in the shift
toChange, then that shift will be changed
to accomidate the newEmployee (if there are more
than one match, then only one will be changed)
toChange
- the shift that is being changednewEmployee
- the new employee to associate with the shiftpublic java.util.Vector GetEmployeeShifts(Employees toGet)
Preconditions:
(none)
Posconditions:
The method will return all of the shifts
that have been assigned to the employee
toGet
The shifts will be returned as a vector
of shifts
toGet
- the employee to get shifts forpublic java.util.Vector GetShifts()
Preconditions:
(none)
Postconditions:
The method will return all of the shifts that
have been placed inside the template
The shifts will be returned as a vector of shifts
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |