Class HourlyScheduler
java.lang.Object
com.northconcepts.datapipeline.schedule.HourlyScheduler
- All Implemented Interfaces:
Scheduler
Represents a schedule of fixed minutes past each hour (for example: 0, 15, 30, and 45 minutes past each hour).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHourlyScheduler(long... millisecondsPastHour) Creates a schedule at the given offsets in milliseconds past each hour (at least one is required); sorts the given array in place and keeps it. -
Method Summary
Modifier and TypeMethodDescriptionstatic HourlySchedulerfromMinutes(int... minutesPastHour) Creates a schedule at each of the given minutes past the hour.static HourlySchedulerfromMinutesPeriod(int firstMinutes, int periodInMinutes) Creates a schedule atfirstMinutespast each hour and then everyperiodInMinutesminutes until the hour ends (for example, 5 and 20 give 5, 25 and 45 minutes past each hour).long[]Returns a copy of this schedule's offsets in ascending order.longgetNextTime(long fromMillis) Returns the next time in this schedule after the specified time.toString()
-
Field Details
-
SECOND
public static final long SECOND- See Also:
-
MINUTE
public static final long MINUTE- See Also:
-
HOUR
public static final long HOUR- See Also:
-
-
Constructor Details
-
HourlyScheduler
public HourlyScheduler(long... millisecondsPastHour) Creates a schedule at the given offsets in milliseconds past each hour (at least one is required); sorts the given array in place and keeps it.
-
-
Method Details
-
fromMinutesPeriod
Creates a schedule atfirstMinutespast each hour and then everyperiodInMinutesminutes until the hour ends (for example, 5 and 20 give 5, 25 and 45 minutes past each hour). -
fromMinutes
Creates a schedule at each of the given minutes past the hour. -
getMillisecondsPastHour
public long[] getMillisecondsPastHour()Returns a copy of this schedule's offsets in ascending order. -
getNextTime
public long getNextTime(long fromMillis) Description copied from interface:SchedulerReturns the next time in this schedule after the specified time.- Specified by:
getNextTimein interfaceScheduler
-
toString
-