public class Section
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Section()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addDayForce(int day,
int start,
int end)
Conusmes a day, start time and end time.
|
void |
addForbiddenAssistant(Position position,
Assistant assistant)
Pairs the specified position and assistant and marks them as a forbidden pairing.
|
Position |
addLAPosition()
Add a new LA position that can potentially be filled by an assistant
|
void |
addRequiredAssistant(Position position,
Assistant a)
Adds the assistant to the provided position.
|
void |
addSkill(Skill skill)
Add a skill that is required to be a TA or LA for the section.
|
Position |
addTAPosition()
Create a TA position which can potentially be filled by an assistant
|
void |
addTime(TimeBlock time)
Adds a time that the section
|
void |
allowAssistant(Assistant a)
Allows an assistant to be considered for a position.
|
void |
clean(java.util.ArrayList<Assistant> assistants,
java.util.ArrayList<Skill> skills,
java.util.ArrayList<Instructor> instructors)
Consumes an ArrayLIst of assistants, skills, and instructors
and then removes all of the elements from the three
arraylists
|
Section |
copy()
Clones all of the data for the section
|
java.lang.String |
describe()
Returns a description of the section in plaintext string.
|
TimeBlock |
getCurrentTime()
Returns the time that the section meets.
|
int |
getEnrolled()
Gets the number of enrolled students for the section.
|
int |
getEnrolledMax()
Gets the maximum number of students that can be enrolled in the section.
|
java.util.HashMap<Position,java.util.ArrayList<Assistant>> |
getForbiddenAssistants()
Gets the assistants which are forbidden from being mapped to specified positions.
|
java.util.ArrayList<Assistant> |
getForbiddenAssistants(Position position)
Returns an ArrayList of the assistants forbidden
from being assigned to the supplied position
|
java.lang.String |
getId()
Get the id(name) of the section.
|
Instructor |
getInstructor()
Gets the Instructor for the section.
|
int |
getLAOrder(Position position)
Gets an ordered list of the LAs
|
java.util.ArrayList<Position> |
getLAs()
Gets the LAs for the section.
|
java.lang.String |
getLocation()
Gets the location of the section.
|
java.util.ArrayList<Position> |
getPositions()
Returns a list of the positions, both open and filled.
|
Assistant |
getRequiredAssistant(Position position)
Reutrns the assistant that is required to be assigned
to the supplied position
|
java.util.HashMap<Position,Assistant> |
getRequiredAssistants()
Gets the hashmap that contains the required assistants, mapped to positions, for the section.
|
java.util.HashSet<Skill> |
getSkillsNeeded()
Gets the list of skills needed to hold a ta or la position for the section.
|
java.util.ArrayList<Position> |
getSortedPositions()
Returns an ordered list of the Positions.
|
int |
getTAOrder(Position position)
Gets an ordered list of the TAs
|
java.util.ArrayList<Position> |
getTAs()
Gets the TAs for the section.
|
java.util.ArrayList<TimeBlock> |
getTime()
Gets the time for the section.
|
boolean |
hasDay(int day)
Checks to see if section meets on the supplied day.
|
boolean |
hasForbiddenAssistants(Position position)
Checks to see if the supplied position has any assistants
forbidden from being assigned to it.
|
boolean |
hasRequiredAssistant(Position position)
Checks to see if the supplied position has any assistants
that are required to be assingned to it.
|
boolean |
hasSkill(Skill selectedSkill)
Check to see if the supplied skill is already in the
list of skills required for an assistant to be assigned
to a section.
|
boolean |
hasTime(TimeBlock time)
Checks to see if the section meets at the supplied time.
|
boolean |
intersect(Section secondSection)
Checks to see if there is a time conflict
|
boolean |
isActive()
Gets whether the section is active.
|
boolean |
isAssistantsPresent()
Gets the state of the assistantsPresent flag.
|
boolean |
isForbiddenAssistant(Position aPosition,
Assistant anAssistant)
Checks to see if the assistant is forbidden from being paired with the specified section.
|
boolean |
isRequiredAssistant(Position aPosition,
Assistant anAssistant)
Checks to see if the assistant and position pairing is required.
|
void |
optionalizeAssistant(Assistant a)
TODO
|
void |
removeDay(int day)
Consumes a day.
|
void |
removeLA(Position position)
Removes the selected La position from the section.
|
void |
removeSkill(Skill selectedSkill)
Removes the supplied skill from the list of skills required
for an assistant to be assigned to the section
|
void |
removeTA(Position position)
Reomoves the selected Ta Position from the section.
|
void |
removeTime(TimeBlock time)
Removes a time that the section meets.
|
void |
restore(Section sectionBackup)
Restores the section data to the data stored in the backup,
reverting any changes
|
void |
setActive(boolean active)
Sets the section to an active state.
|
void |
setAssistantsPresent(boolean assistantsPresent)
Set the asssistantPresent flag which tells whether the assistant is currently
present for the section.
|
void |
setEndTime(int em,
int eh)
Consumes a start hour and start minuite.
|
void |
setEnrolled(int enrolled)
Sets the number of enrolled students for the section.
|
void |
setEnrolledMax(int enrolledMax)
Sets the maximum number of students that can be enrolled in the section.
|
void |
setForbiddenAssistants(java.util.HashMap<Position,java.util.ArrayList<Assistant>> forbiddenAssistants)
Set the assistants which are forbidden from being mapped to specified positions;
|
void |
setForbiddenAssistants(Position position,
java.util.ArrayList<Assistant> data)
Sets the assistant as forbidden for the selected position for the section.
|
void |
setId(java.lang.String id)
Set the id(name) of the section.
|
void |
setInstructor(Instructor instructor)
Sets the Instructor for the section.
|
void |
setLAs(java.util.ArrayList<Position> las)
Sets the LAs for the section.
|
void |
setLocation(java.lang.String location)
Sets the location of the section.
|
void |
setRequiredAssistants(java.util.HashMap<Position,Assistant> requiredAssistants)
Sets a list of assistants, which are mapped to positions, who are required for the section.
|
void |
setRequiredAssistants(Position position,
Assistant data)
Sets the assistant as required for the selected position for this section.
|
void |
setSkillsNeeded(java.util.HashSet<Skill> skillsNeeded)
Sets the list of skills needed to hold a ta or la position for the section.
|
void |
setStartTime(int sm,
int sh)
Consumes a start hour and start minuite.
|
void |
setTAs(java.util.ArrayList<Position> tas)
Sets the TAs for the section.
|
void |
setTime(java.util.ArrayList<TimeBlock> time)
Sets the time for the section.
|
void |
setTime(int start,
int end)
Sets the time that the section meets.
|
java.lang.String |
toString()
Returns the id.
|
public java.lang.String toString()
toString
in class java.lang.Object
public void addRequiredAssistant(Position position, Assistant a)
position
- a
- public void setActive(boolean active)
active
- public boolean isActive()
public void setLocation(java.lang.String location)
location
- public java.lang.String getLocation()
public void setEnrolled(int enrolled)
enrolled
- public int getEnrolled()
public void setEnrolledMax(int enrolledMax)
enrolledMax
- public int getEnrolledMax()
public void setTime(java.util.ArrayList<TimeBlock> time)
time
- public void addTime(TimeBlock time)
time
- public void removeTime(TimeBlock time)
time
- public boolean hasTime(TimeBlock time)
time
- public void setStartTime(int sm, int sh)
sm
- sh
- public void setEndTime(int em, int eh)
em
- eh
- public void addDayForce(int day, int start, int end)
day
- day of the weekstart
- start timeend
- end timepublic void removeDay(int day)
day
- public java.util.ArrayList<TimeBlock> getTime()
public void setSkillsNeeded(java.util.HashSet<Skill> skillsNeeded)
skillsNeeded
- public java.util.HashSet<Skill> getSkillsNeeded()
public void setTAs(java.util.ArrayList<Position> tas)
tas
- public java.util.ArrayList<Position> getTAs()
public void setLAs(java.util.ArrayList<Position> las)
las
- public java.util.ArrayList<Position> getLAs()
public void setAssistantsPresent(boolean assistantsPresent)
assistantsPresent
- public boolean isAssistantsPresent()
public void setInstructor(Instructor instructor)
instructor
- public Instructor getInstructor()
public void setRequiredAssistants(java.util.HashMap<Position,Assistant> requiredAssistants)
requiredAssistants
- public java.util.HashMap<Position,Assistant> getRequiredAssistants()
public void setForbiddenAssistants(java.util.HashMap<Position,java.util.ArrayList<Assistant>> forbiddenAssistants)
forbiddenAssistants
- public java.util.HashMap<Position,java.util.ArrayList<Assistant>> getForbiddenAssistants()
public Position addLAPosition()
public Position addTAPosition()
public void setId(java.lang.String id)
id
- public java.lang.String getId()
public boolean isForbiddenAssistant(Position aPosition, Assistant anAssistant)
aPosition
- anAssistant
- public boolean isRequiredAssistant(Position aPosition, Assistant anAssistant)
aPosition
- anAssistant
- public void addForbiddenAssistant(Position position, Assistant assistant)
position
- assistant
- public void addSkill(Skill skill)
skill
- public boolean intersect(Section secondSection)
secondSection
- public java.lang.String describe()
public int getTAOrder(Position position)
position
- public int getLAOrder(Position position)
position
- public java.util.ArrayList<Position> getPositions()
public void allowAssistant(Assistant a)
a
- public void optionalizeAssistant(Assistant a)
a
- public java.util.ArrayList<Position> getSortedPositions()
public boolean hasSkill(Skill selectedSkill)
selectedSkill
- public void removeSkill(Skill selectedSkill)
selectedSkill
- public boolean hasForbiddenAssistants(Position position)
position
- public boolean hasRequiredAssistant(Position position)
position
- public java.util.ArrayList<Assistant> getForbiddenAssistants(Position position)
position
- public Assistant getRequiredAssistant(Position position)
position
- public void clean(java.util.ArrayList<Assistant> assistants, java.util.ArrayList<Skill> skills, java.util.ArrayList<Instructor> instructors)
assistants
- skills
- instructors
- public void restore(Section sectionBackup)
sectionBackup
- public Section copy()
public void removeTA(Position position)
position
- public void removeLA(Position position)
position
- public TimeBlock getCurrentTime()
public boolean hasDay(int day)
day
- public void setTime(int start, int end)
start
- end
- public void setRequiredAssistants(Position position, Assistant data)
position
- data
-