uc 04 - yshehab/SchoolRoomBooking GitHub Wiki
public void cancel(Booking aBooking)
Given: The Booking object, booking82
- booking82 checks that all of the Date objects held in it's dates attribute are after the current date.
As the check suceeds: - booking82 removes it's reference to dateRange43
- permit3 removes it's reference to booking82
- school3 removes it's reference to booking82
- dateRange43 removes it's references to date4, date5 and date6 (possibly not needed due to garbage collection of objects with cyclical dependencies)
- booking82, date4, date5, date6, dateRange43 and charge 67 are now eligible for GC
Given: The Booking object, booking35
- booking35 checks that all of the Date objects held in it's dates attribute are after the current date.
As the check fails: - booking35 checks that some of the Date objects held in it's dates attribute are the current date or later.
As the check suceeds: - dateRange42 removes it's reference to date51 and date61
No dates are in the future - exception thrown
None
public void cancel(Booking aBooking)
Precondition: one or more of the Date objects referenced by aBooking's date attribute should be today or in the future. If not an exception is thrown.
Post-Condition: If some of the Date objects linked to the dateRange object aDateRange linked to aBooking are today or in the future, those Date objects are removed from aDateRange.
If all the Date objects linked to the dateRange object aDateRange linked to aBooking are today or in the future then aBooking and its linked Charge, DateRange and Date objects are removed from the system.
None
public void cancel()
Precondition: one or more of the Date objects referenced by aBooking's date attribute should be today or in the future. If not an exception is thrown.
Post-Condition: If some of the Date objects linked to the dateRange object aDateRange linked to the receiver are today or in in the future, those Date objects are removed from aDateRange.
If all the Date objects linked to the dateRange object aDateRange linked to the receiver are today or in the future then aBooking and its linked Charge, DateRange and Date objects are removed from the system.
None
public Boolean cancel()
Precondition: one or more of the Date objects referenced by aBooking's date attribute should be today or in the future. If not an exception is thrown.
Post-Condition: If some of the Date objects linked to the receiver are today or in the future, those Date objects are removed from the receiver and false is returned.
If all the Date objects linked to the receiver are today or in the future then the receiver removes all its references to those Date objects and true is returned.
None
public void remove(Booking aBooking)
Post-Condition: the receivers reference to aBooking is removed
None
public void remove(Booking aBooking)
Post-Condition: the receivers reference to aBooking is removed
None