uc 08 - yshehab/SchoolRoomBooking GitHub Wiki
Collection<Booking> getBookings(Room aRoom)
Given: The Room object, room356
- Access the school object linked to room356, which in this case is school3
- Create a new empty collection, results.
- Access the collection of Booking objects in school3 linked to room356, which in this case is {booking38, booking55, booking 82}.
- For each Booking object accessed in step3, check if it is today or in the future.
- If it is, add the Booking object to results
- Return results
If there are no Bookings linked to an Room then return an empty collection
If all Bookings linked to a Room are in the past then return an empty collection
public Boolean isFuture()
Post condition: returns True is any of the dates in the receivers dateRange Range are today or after the current date.
private School school
public collection <Booking> getBookings()
Post condition: returns a collection of Booking objects for the current day and the future which are linked to the receiver
private collection<Room, Booking> bookings
public collection<Booking> getBookings(Room aRooom)
Post condition: returns aCollection of the Booking objects linked to aRoom
Collection<Booking> getBookings(Room aRoom)
Post condition: returns a collection of Booking objects which are linked to aRoom
isIn from Room to School
isIn from School to Room
has from School to Booking
Note: Do we include the current day as in the future?? Yes - updated to include today as the future.