pkg dateTime RepeatRange - yshehab/SchoolRoomBooking GitHub Wiki
RepeatRate enum
Overview
RepeatRate is an Enum that is supplied as an argument to a Range class; it is polymorphic in the sense that it may mean different things to the classes that implement the Repeat interface.
RepeatRate is unusual in that it is meant to be extended as the functionality of the core and Range classes gets better, this ensures that any implementing UI updates silently.
RepeatRate deals with the Enums and Date (and potentially other implementing Classes) differently. This is an implementation detail; neither the UI or persistence layers should notice this.
Any RepeatRate may be an argument for any Range of an Enum/Class that implements Repeat. If the RepeatRate is inappropriate: implementing Enums will return Enum.NONE, implementing classes will return the argument.
Package
Static Members
SINGLE
NEXT
WEEKLY
MONTHLY
YEARLY
Static Methods
Those inherited from Enum
Attributes
private int rate
the repeat rate
private int field
the static Date field to use rate on
Links
none
Constructor
private RepeatRate(int rate, int field)
Protocol
public String getDisplayString()
Post-condition: returns a string representation of the Enum.
private int getRate()
post-condition: returns the integer value of rate.
private int getField()
post-condition: returns the integer value of Date.field.