pkg core School - yshehab/SchoolRoomBooking GitHub Wiki

Class Description

Package

Core

Class

School
A school in the system

Attributes

Links

Collection<Member> members

References a collection of all linked Member objects

Collection<Permit> permits

References a collection of all linked Permit objects

private collection<Room, Booking> bookings

References a collection of all linked Room objects and their respective Booking objects

Constructor

___School(String aName, Address anAddress, Room aRoom) ___

Postcondition: initialises a new School object with the given attribute values.

Protocol

___public Boolean hasMember(Name aName, Address anAddress, Email anEmail) ___

Postcondition: returns True if the receivers members contains a Member with the supplied attributes
Note: at this point we have not created a Member object for comparison using isMember()

public void addBooking(Room aRoom, Booking aBooking)

Post condition: the collection bookings contains (aRoom, aBooking)

public Boolean isMember(Member aMember)

Post condition: returns true if aMember works at the receiving school, False otherwise.

public Boolean hasPermit(Permit aPermit)

Post condition: returns true if aPermit is issued for the receiving school, False otherwise.

public collection<Booking> getBookings(Date aDate)

Post condition: returns a collection of all Booking objects linked to the receiver whose date attribute contains a Date object matching aDate.

public collection<Booking> getBookings(Room aRoom)

Post condition: returns a collection of Booking objects for the current day and the future which are linked to aRoom

public void addMember(Member aMember)

Postcondition: a reference to aMember is recorded.

public collection<Room> getRooms())

Postcondition: a collection of linked Room objects is returned.

public Permit addPermit(Permit aPermit)

Postcondition: permits contains aPermit

public void addRoom(String aName, Collection<Asset> assets, int capacity, RoomType roomtype)

Precondition: The receiver should not be linked to a Room object with the same name value as aName; if so an exception is thrown. Postcondition: a new Room object with the given attribute values and a reference recorded to it..

public void remove(Booking aBooking)

Post-Condition: the receiver_s reference to aBooking is removed

⚠️ **GitHub.com Fallback** ⚠️