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()
SctAssignment
getId
in interface SctAssignment
public TimeLocation getTime()
SctAssignment
getTime
in interface SctAssignment
public boolean isAllowOverlap()
isAllowOverlap
in interface SctAssignment
public List<RoomLocation> getRooms()
SctAssignment
getRooms
in interface SctAssignment
RoomLocation
public int getNrRooms()
SctAssignment
getNrRooms
in interface SctAssignment
public boolean isOverlapping(SctAssignment assignment)
SctAssignment
isOverlapping
in interface SctAssignment
assignment
- another assignmentpublic boolean isOverlapping(Set<? extends SctAssignment> assignments)
SctAssignment
isOverlapping
in interface SctAssignment
assignments
- a set of assignmentspublic void assigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
SctAssignment
Request
.assigned
in interface SctAssignment
assignment
- current assignmentenrollment
- an enrollment that was just assignedpublic void unassigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
SctAssignment
Request
.unassigned
in interface SctAssignment
assignment
- current assignmentenrollment
- an enrollment that was just unassignedpublic Set<Enrollment> getEnrollments(Assignment<Request,Enrollment> assignment)
getEnrollments
in interface SctAssignment
assignment
- current assignmentspublic int compareById(SctAssignment a)
SctAssignment
compareById
in interface SctAssignment
a
- another section assignmentpublic Enrollment createEnrollment()