Class Scheduler<T>

  • All Implemented Interfaces:
    IScheduler<T>, java.lang.AutoCloseable

    public class Scheduler<T>
    extends java.lang.Object
    implements IScheduler<T>
    • Constructor Summary

      Constructors 
      Constructor Description
      Scheduler​(java.lang.String iThreadName, int iPeriodInMinutes, IScheduler.ITask<T> iTask)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      close shuts down the scheduling.
      java.util.ArrayList<java.util.Calendar> getNextRuns​(int iNumberOfRuns)
      getNextRuns gets the time of the next iNumberOfRuns.
      static int getSecondsSinceMidnight​(java.util.Calendar iCal)  
      void triggerTask​(T iT)
      triggerTask runs a task right now (even when it is not time for the schedule).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Scheduler

        public Scheduler​(java.lang.String iThreadName,
                         int iPeriodInMinutes,
                         IScheduler.ITask<T> iTask)
    • Method Detail

      • getNextRuns

        public java.util.ArrayList<java.util.Calendar> getNextRuns​(int iNumberOfRuns)
        Description copied from interface: IScheduler
        getNextRuns gets the time of the next iNumberOfRuns. The times do not accout for any triggerTask() calls; it ONLY returns regularly scheduled times
        Specified by:
        getNextRuns in interface IScheduler<T>
      • triggerTask

        public void triggerTask​(T iT)
        Description copied from interface: IScheduler
        triggerTask runs a task right now (even when it is not time for the schedule). The schedule times are not affected by this task
        Specified by:
        triggerTask in interface IScheduler<T>
      • close

        public void close()
        Description copied from interface: IScheduler
        close shuts down the scheduling. Any tasks currently running will continue until completion. No new tasks will be run. It waits until all currently running tasks are complete, so when this method returns you know the thread is gone
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface IScheduler<T>
      • getSecondsSinceMidnight

        public static int getSecondsSinceMidnight​(java.util.Calendar iCal)