Interface TaskRunnable

    • Method Detail

      • addElement

        boolean addElement​(Object key)
        Adds an element to this TaskRunnable.
        Parameters:
        key - Element to be added to this TaskRunnable
        Returns:
        a boolean to indicate whether the add success
      • removeElement

        boolean removeElement​(Object key)
        Removes an element from this TaskRunnable.
        Parameters:
        key - Element to be removed from this TaskRunnable
        Returns:
        A boolean to indicate whether the remove success
      • isEmpty

        boolean isEmpty()
        Indicates whether this TaskRunnable is empty.
        Returns:
        A boolean to indicate whether this TaskRunnable is empty
      • setNext

        void setNext​(TaskRunnable task)
        Sets the TaskRunnable next to this TaskRunnable in the linked-list. It is for internal use only.
        Parameters:
        task - The next TaskRunnable
      • setPrevious

        void setPrevious​(TaskRunnable task)
        Sets the TaskRunnable previous to this TaskRunnable in the linked-list. It is for internal use only.
        Parameters:
        task - The previous TaskRunnable
      • setHeadTask

        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. It is for internal use only.
        Parameters:
        headTask - The HeadTaskRunnable
      • getHeadTask

        HeadTaskRunnable getHeadTask()
        Returns the head task for this linkable TaskRunnable. The head task of this TaskRunnable will be returned or null if it doesn't have one. HeadTask works as a lock when the elements of the linked task is going to be changed.
        Returns:
        The head task of this linkable TaskRunnable
      • getRunPeriod

        long getRunPeriod()
        Returns the run period of this TaskRunnable.
        Returns:
        A long value to indicate the run period
      • next

        TaskRunnable next()
        Returns the TaskRunnable next to this TaskRunnable in the linked-list.
        Returns:
        next TaskRunnable object or null if it is not set
      • previous

        TaskRunnable previous()
        Returns the TaskRunnable previous to this TaskRunnable in the linked-list.
        Returns:
        previous TaskRunnable object or null if it is not set
      • scheduledExecutionTime

        long scheduledExecutionTime()
        Returns the scheduled time of this TaskRunnable.
        Returns:
        A long value indicate the time this TaskRunnable is scheduled, or -1 if it is not scheduled yet
      • cancel

        void cancel()
        Cancel the task from scheduled Timer.