pkg dateTime Session - yshehab/SchoolRoomBooking GitHub Wiki
Session enum
Overview
An Enum representing a use session for a swimming pool, games hall etc. which may be hired by different groups on any given day. Session implements the Repeat interface.
Session is polymorphic in that it may represent different times for different schools/rooms/areas.
Package
Static Members
SESSION_1
SESSION_2
SESSION_3
SESSION_4
SESSION_4
SESSION_5
SESSION_6
SESSION_7
SESSION_8
SESSION_9
SESSION_10
SESSION_11
SESSION_12
SESSION_13
NONE
Static Methods
Those inherited from Enum
Attributes
private String display
Links
None
Constructor
private Session(String display)
Protocol
public Session add(RepeatRate rate)
Post-condition: Returns the Session after the the supplied session argument if the rate argument is RepeatRate.rate ## 1 and the receiver is not the final Session. Otherwise Session.NONE.
public boolean isAfter(Session session)
Post-condition: Returns true if session is naturally ordered after the receiver.
public String toDisplayString()
Post-condition: Returns a string representation of the receiver.
Examples
Session.SESSION_1.add(RepeatRate.NEXT); //returns Session.SESSION_2
Session.SESSION_10.add(RepeatRate.WEEKLY); //returns Session.NONE
Session.SESSION_2.add(RepeatRate.SINGLE);//returns Session.NONE