Class TaskImpl

  • All Implemented Interfaces:
    java.lang.Comparable<TaskImpl>, Extendable, Task

    public class TaskImpl
    extends java.lang.Object
    implements Task, java.lang.Comparable<TaskImpl>
    • Constructor Detail

      • TaskImpl

        public TaskImpl​(long deadline,
                        int counter)
    • Method Detail

      • compareTo

        public int compareTo​(TaskImpl other)
        Specified by:
        compareTo in interface java.lang.Comparable<TaskImpl>
      • deadline

        public long deadline()
        Specified by:
        deadline in interface Task
        Returns:
        the deadline at which the handler associated with the scheduled task should be delivered a Event.Type.TIMER_TASK event.
      • isCancelled

        public boolean isCancelled()
      • cancel

        public void cancel()
        Description copied from interface: Task
        Cancel the execution of this task. No-op if invoked after the task was already executed.
        Specified by:
        cancel in interface Task
      • setReactor

        public void setReactor​(Reactor reactor)
      • getReactor

        public Reactor getReactor()
        Specified by:
        getReactor in interface Task
        Returns:
        the reactor that created this task.