Class TimedSchedule

    • Method Detail

      • equals

        public boolean equals​(Object o)
        Autogenerated equals.
        Overrides:
        equals in class Schedule
        Parameters:
        o - The object to compare with
        Returns:
        Whether objects are equal
      • hashCode

        public int hashCode()
        Autogenerated hashcode method.
        Overrides:
        hashCode in class Schedule
        Returns:
        the hashcode
      • getNextEvent

        public Date getNextEvent​(Date lastEvent,
                                 int numPreviousEvents)
        Return the date at which the next event will happen. If the calculated next date is exactly equal to the end date then that value is returned. If it is after the end date, null is returned.
        Specified by:
        getNextEvent in class Schedule
        Parameters:
        lastEvent - The time at which the previous event happened. If this is null, then the method returns null. Ie once one is after the last event one is always after the last event.
        numPreviousEvents - How many events have previously happened (ignored).
        Returns:
        The date of the next event to happen or null for no more events.
        Throws:
        ArgumentNotValid - if numPreviousEvents is negative
      • getEndDate

        public Date getEndDate()
        Get the last possible time an event may be allowed.
        Returns:
        The last date, null means no last date, continue forever.
      • toString

        public String toString()
        Human readable represenation of this object.
        Overrides:
        toString in class Object
        Returns:
        Human readble representation