Class HourlyScheduler

java.lang.Object
com.northconcepts.datapipeline.schedule.HourlyScheduler
All Implemented Interfaces:
Scheduler

public class HourlyScheduler extends Object implements Scheduler
Represents a schedule of fixed minutes past each hour (for example: 0, 15, 30, and 45 minutes past each hour).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
     
    static final long
     
    static final long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    fromMinutes(int... minutesPastHour)
    Creates a schedule at each of the given minutes past the hour.
    fromMinutesPeriod(int firstMinutes, int periodInMinutes)
    Creates a schedule at firstMinutes past each hour and then every periodInMinutes minutes 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.
    long
    getNextTime(long fromMillis)
    Returns the next time in this schedule after the specified time.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • 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

      public static HourlyScheduler fromMinutesPeriod(int firstMinutes, int periodInMinutes)
      Creates a schedule at firstMinutes past each hour and then every periodInMinutes minutes until the hour ends (for example, 5 and 20 give 5, 25 and 45 minutes past each hour).
    • fromMinutes

      public static HourlyScheduler fromMinutes(int... minutesPastHour)
      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: Scheduler
      Returns the next time in this schedule after the specified time.
      Specified by:
      getNextTime in interface Scheduler
    • toString

      public String toString()
      Overrides:
      toString in class Object