Class GeneralTaskRunnable

    • Constructor Detail

      • GeneralTaskRunnable

        public GeneralTaskRunnable()
    • Method Detail

      • setHeadTask

        public void setHeadTask​(HeadTaskRunnable headTask)
        Sets the head task for this linkable TaskRunnable The head task of this TaskRunnable will be set. HeadTask works as a lock when the elements of the linked task is going to be changed.
        Specified by:
        setHeadTask in interface TaskRunnable
        Parameters:
        headTask - The HeadTaskRunnable
      • getHeadTask

        public HeadTaskRunnable getHeadTask()
        Returns the head task of this linkable TaskRunnable.
        Specified by:
        getHeadTask in interface TaskRunnable
        Returns:
        The head task of this linkable TaskRunnable
      • previous

        public TaskRunnable previous()
        Returns the TaskRunnable previous to this TaskRunnable in the linked-list. The correct HeadTaskRunnable must be locked before calling this function.
        Specified by:
        previous in interface TaskRunnable
        Returns:
        previous TaskRunnable object or null if it is not set
      • next

        public TaskRunnable next()
        Returns the TaskRunnable next to this TaskRunnable in the linked-list. The correct HeadTaskRunnable must be locked before calling this function.
        Specified by:
        next in interface TaskRunnable
        Returns:
        next TaskRunnable object or null if it is not set
      • setPrevious

        public void setPrevious​(TaskRunnable task)
        Sets the TaskRunnable previous to this TaskRunnable in the linked-list. The correct HeadTaskRunnable must be locked before calling this function.
        Specified by:
        setPrevious in interface TaskRunnable
        Parameters:
        task - The previous TaskRunnable
      • setNext

        public void setNext​(TaskRunnable task)
        Sets the TaskRunnable next to this TaskRunnable in the linked-list. The correct HeadTaskRunnable must be locked before calling this function.
        Specified by:
        setNext in interface TaskRunnable
        Parameters:
        task - The next TaskRunnable
      • scheduledExecutionTime

        public long scheduledExecutionTime()
        Returns the scheduled time of this TaskRunnable.
        Specified by:
        scheduledExecutionTime in interface TaskRunnable
        Returns:
        A long value indicate the time this TaskRunnable is scheduled, or -1 if it is not scheduled yet
      • isScheduled

        public boolean isScheduled()
        Returns true if this TaskRunnable is scheduled to run; otherwise returns false.
        Returns:
        A boolean value indicating whether or not this TaskRunnable is scheduled.
      • cancel

        public void cancel()
        Implements for TaskRunnable interface. Cancels the task from the associated Timer.
        Specified by:
        cancel in interface TaskRunnable