public class Unavailability extends Object implements SctAssignment
| Constructor and Description |
|---|
Unavailability(Student student,
Section section,
boolean canOverlap)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
assigned(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Enrollment with this assignment was assigned to a
Request. |
int |
compareById(SctAssignment a)
Compare assignments by unique ids.
|
Enrollment |
createEnrollment()
Create dummy enrollment of this unavailability
|
boolean |
equals(Object o) |
Long |
getCourseId()
Optional course id (within the course of
getSection() |
String |
getCourseName()
Course name taken from the
getSection() and optional getCourseId(). |
Set<Enrollment> |
getEnrollments(Assignment<Request,Enrollment> assignment)
Not used, always null
|
long |
getId()
Unique id
|
int |
getNrRooms()
Number of rooms in which a section meets
|
List<RoomLocation> |
getRooms()
Room assignment
|
Section |
getSection()
Section
|
String |
getSectionName()
Section name using
Section.getName(long) when the optional course id is provided,
using Section.getName() otherwise. |
Student |
getStudent()
Student
|
TimeLocation |
getTime()
Time assignment
|
int |
hashCode() |
boolean |
isAllowOverlap()
Can student have classes during this unavailability?
|
boolean |
isOverlapping(SctAssignment assignment)
True, if this assignment is overlapping in time and space with the given
assignment.
|
boolean |
isOverlapping(Set<? extends SctAssignment> assignments)
True, if this assignment is overlapping in time and space with the given
set of assignments.
|
boolean |
isTeachingAssignment()
Is this a teaching assignment
|
void |
setCourseId(Long courseId)
Optional course id (within the course of
getSection() |
void |
setTeachingAssignment(boolean ta)
Is this a teaching assignment, defaults to true
|
String |
toString() |
void |
unassigned(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Enrollment with this assignment was unassigned from a
Request. |
public Unavailability(Student student, Section section, boolean canOverlap)
student - studentsection - section that the student is teachingcanOverlap - true if student can have classes during the time, but the overlapping time should be minimizedpublic Student getStudent()
public Section getSection()
public Long getCourseId()
getSection()public void setCourseId(Long courseId)
getSection()public boolean isTeachingAssignment()
public void setTeachingAssignment(boolean ta)
public String getCourseName()
getSection() and optional getCourseId().
Name of the controlling course is used when no course id is set.public String getSectionName()
Section.getName(long) when the optional course id is provided,
using Section.getName() otherwise.public long getId()
SctAssignmentgetId in interface SctAssignmentpublic TimeLocation getTime()
SctAssignmentgetTime in interface SctAssignmentpublic boolean isAllowOverlap()
isAllowOverlap in interface SctAssignmentpublic List<RoomLocation> getRooms()
SctAssignmentgetRooms in interface SctAssignmentRoomLocationpublic int getNrRooms()
SctAssignmentgetNrRooms in interface SctAssignmentpublic boolean isOverlapping(SctAssignment assignment)
SctAssignmentisOverlapping in interface SctAssignmentassignment - another assignmentpublic boolean isOverlapping(Set<? extends SctAssignment> assignments)
SctAssignmentisOverlapping in interface SctAssignmentassignments - a set of assignmentspublic void assigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
SctAssignmentRequest.assigned in interface SctAssignmentassignment - current assignmentenrollment - an enrollment that was just assignedpublic void unassigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
SctAssignmentRequest.unassigned in interface SctAssignmentassignment - current assignmentenrollment - an enrollment that was just unassignedpublic Set<Enrollment> getEnrollments(Assignment<Request,Enrollment> assignment)
getEnrollments in interface SctAssignmentassignment - current assignmentspublic int compareById(SctAssignment a)
SctAssignmentcompareById in interface SctAssignmenta - another section assignmentpublic Enrollment createEnrollment()