Class OperationManager.ScheduledOperation

  • Enclosing class:
    OperationManager

    protected static class OperationManager.ScheduledOperation
    extends java.lang.Object
    Encapsulates an operation that has been scheduled, along with any delay or repeat.
    Author:
    Garret Wilson
    • Constructor Detail

      • ScheduledOperation

        public ScheduledOperation​(Operation operation,
                                  Duration delayTime,
                                  boolean repeated)
        Constructor.
        Parameters:
        operation - The scheduled operation.
        delayTime - The delay past the scheduled time before the operation should begin (which may be 0).
        repeated - Whether this operation should be repeated.
        Throws:
        java.lang.NullPointerException - if the given operation and/or delay time is null.
    • Method Detail

      • getOperation

        public Operation getOperation()
        Returns:
        The scheduled operation.
      • getScheduledTime

        public Time getScheduledTime()
        Returns:
        The time the operation was scheduled.
      • resetScheduledTime

        public Time resetScheduledTime()
        Resets the scheduled time to the current time.
        Returns:
        The new scheduled time.
      • getDelayDuration

        public Duration getDelayDuration()
        Returns:
        The delay past the scheduled time before the operation should begin (which may be 0).
      • isRepeated

        public boolean isRepeated()
        Returns:
        Whether this operation should be repeated.