com.cometway.util
Interface ISchedule

All Known Implementing Classes:
Schedule

public interface ISchedule

A class can implement ISchedule when it wants to represent a list of scheduled times. Keep in mind that implementations of this interface have no concept of the current date, only the dates which are given.


Method Summary
 long getMaximumLatency()
          Returns the maximum number of milliseconds each event in this schedule can be delayed before timing out.
 java.util.Date getNextDate(java.util.Date startDate)
          Returns the next Date after startDate when a scheduled event should occur.
 java.lang.String getScheduleString()
          Returns a String representation of the schedule.
 boolean isValid()
          Returns true if the schedule has been properly initialized.
 boolean setSchedule(java.lang.String s)
          Sets the schedule based on a syntax-dependent String description.
 

Method Detail

getMaximumLatency

long getMaximumLatency()
Returns the maximum number of milliseconds each event in this schedule can be delayed before timing out.

Returns:
the maximum number of milliseconds the schedule can be delayed.

getNextDate

java.util.Date getNextDate(java.util.Date startDate)
Returns the next Date after startDate when a scheduled event should occur. If the schedule has expired (has no future events) this method should return null.

Parameters:
startDate - a Date reference.
Returns:
a reference to the first Date after startDate; null if no future dates are scheduled.

getScheduleString

java.lang.String getScheduleString()
Returns a String representation of the schedule. This String should be in a format which the setSchedule method can process.

Returns:
a String reference.

isValid

boolean isValid()
Returns true if the schedule has been properly initialized. A schedule is only invalid when its internal data has not been initialized or has somehow become incomprehensible to the point where getNextDate fails.

Returns:
true if the schedule is valid; false otherwise.

setSchedule

boolean setSchedule(java.lang.String s)
Sets the schedule based on a syntax-dependent String description. If the description is invalid, this method returns false and subsequent calls to isValid will return false as well. A true result indicates the schedule description was valid, and subsequent calls to isValid will return true.

Parameters:
s - a String reference