pkg core Permit - yshehab/SchoolRoomBooking GitHub Wiki
Core
Permit
A Permit in the system
Collection<Account> accounts
References a collection of all linked Account objects
Collection<Booking> bookings
References a collection of all linked Booking objects
Permit(Member aMember, Organization anOrg)
Post condition: a new Permit object aPermit is created with a unique number. anOrg records a reference to aPermit
___public void addBooking(Booking aBooking) ___
Postcondition: bookings contains aBooking
___public collection <Booking>
getBookings() ___
Postcondition: returns a collection of all linked Booking objects
___public collection <Account>
getAccounts() ___
Postcondition: returns a collection of all linked Account objects
public void remove(Booking aBooking)
Post-Condition: the receiver_s reference to aBooking is removed
public void createAccount()
Post condition: a new Account object is created with it_s cost attribute the sum of the cost attributes of all the receivers linked Booking objects
If the receiver has a linked Account object then an exception is thrown.
If the sum of the cost attributes of all the receivers linked Booking objects # 0, then an exception is thrown.