public abstract class Reservation extends Object implements Comparable<Reservation>
Constructor and Description |
---|
Reservation(long id,
Offering offering)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addConfig(Config config)
Add a configuration (of the offering
getOffering() ) to this reservation |
void |
addSection(Section section)
Add a section (of the offering
getOffering() ) to this reservation. |
void |
assigned(Enrollment enrollment)
Notify reservation about an unassignment
|
abstract boolean |
canAssignOverLimit()
True if can go over the course / config / section limit.
|
boolean |
canEnroll(Enrollment enrollment)
True if the enrollment can be done using this configuration
|
int |
compareTo(Reservation r)
Priority first, than restrictivity (more restrictive first), than availability (more available first), than id
|
Set<Config> |
getConfigs()
One or more configurations on which the reservation is set (optional).
|
Set<Enrollment> |
getEnrollments()
Enrollments assigned using this reservation
|
long |
getId()
Reservation id
|
double |
getLimit()
Reservation limit capped the limit cap (see
getLimitCap() ) |
double |
getLimitCap()
Compute limit cap (maximum number of students that can get into the offering using this reservation)
|
Offering |
getOffering()
Instructional offering on which the reservation is set.
|
abstract int |
getPriority()
Reservation priority (e.g., individual reservations first)
|
abstract double |
getReservationLimit()
Reservation limit
|
double |
getReservedAvailableSpace(Request excludeRequest)
Available reserved space
|
double |
getRestrictivity()
Reservation restrictivity (estimated percentage of enrollments that include this reservation, 1.0 reservation on the whole offering)
|
Map<Subpart,Set<Section>> |
getSections()
One or more sections on which the reservation is set (optional).
|
Set<Section> |
getSections(Subpart subpart)
One or more sections on which the reservation is set (optional).
|
double |
getUsedSpace()
Used space
|
boolean |
isAllowOverlap()
True if holding this reservation allows a student to have attend overlapping class.
|
abstract boolean |
isApplicable(Student student)
Returns true if the student is applicable for the reservation
|
boolean |
isExpired()
True if the reservation is expired.
|
boolean |
isIncluded(Enrollment enrollment)
Return true if the given enrollment meets the reservation.
|
abstract boolean |
mustBeUsed()
If true, student must use the reservation (if applicable)
|
void |
setExpired(boolean expired)
Set reservation expiration.
|
void |
unassigned(Enrollment enrollment)
Notify reservation about an assignment
|
public Reservation(long id, Offering offering)
id
- reservation unique idoffering
- instructional offering on which the reservation is setpublic long getId()
public abstract double getReservationLimit()
public abstract int getPriority()
public abstract boolean isApplicable(Student student)
student
- a studentpublic Offering getOffering()
public Set<Config> getConfigs()
public void addConfig(Config config)
getOffering()
) to this reservationpublic Map<Subpart,Set<Section>> getSections()
public Set<Section> getSections(Subpart subpart)
public void addSection(Section section)
getOffering()
) to this reservation.
This will also add all parent sections and the appropriate configuration to the offering.public boolean isIncluded(Enrollment enrollment)
public boolean canEnroll(Enrollment enrollment)
public void assigned(Enrollment enrollment)
public void unassigned(Enrollment enrollment)
public Set<Enrollment> getEnrollments()
public double getUsedSpace()
public double getReservedAvailableSpace(Request excludeRequest)
excludeRequest
- excluding given request (if not null)public abstract boolean canAssignOverLimit()
public abstract boolean mustBeUsed()
public double getRestrictivity()
public int compareTo(Reservation r)
compareTo
in interface Comparable<Reservation>
public double getLimitCap()
public double getLimit()
getLimitCap()
)public boolean isAllowOverlap()
public void setExpired(boolean expired)
public boolean isExpired()