public class Reservation.ReservationContext extends Object implements AssignmentConstraintContext<Request,Enrollment>
Constructor and Description |
---|
ReservationContext(Assignment<Request,Enrollment> assignment) |
ReservationContext(Reservation.ReservationContext parent) |
Modifier and Type | Method and Description |
---|---|
void |
assigned(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Notify reservation about an unassignment
|
Set<Enrollment> |
getEnrollments()
Enrollments assigned using this reservation
|
double |
getReservedAvailableSpace(Assignment<Request,Enrollment> assignment,
Request excludeRequest)
Available reserved space
|
double |
getUsedSpace()
Used space
|
void |
unassigned(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Notify reservation about an assignment
|
public ReservationContext(Assignment<Request,Enrollment> assignment)
public ReservationContext(Reservation.ReservationContext parent)
public void assigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
assigned
in interface AssignmentConstraintContext<Request,Enrollment>
assignment
- current assignment (with which this context is associated)enrollment
- assigned valuepublic void unassigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
unassigned
in interface AssignmentConstraintContext<Request,Enrollment>
assignment
- current assignment (with which this context is associated)enrollment
- unassigned valuepublic Set<Enrollment> getEnrollments()
public double getUsedSpace()
public double getReservedAvailableSpace(Assignment<Request,Enrollment> assignment, Request excludeRequest)
assignment
- current assignmentexcludeRequest
- excluding given request (if not null)