Class InstantGroupRunnable

  • All Implemented Interfaces:
    ScheduleableGroupAction, TaskRunnable, Runnable
    Direct Known Subclasses:
    StatsRunner

    public class InstantGroupRunnable
    extends InstantRunnable
    implements ScheduleableGroupAction
    Instant task (task will only be run once) which has handler separated (share the same ScheduleableGroupAction) can be scheduled to Timer or TimerPool by using InstantGroupRunnable. All the elements in the same InstantGroupRunnable must have the same scheduled time.
    • Constructor Detail

      • InstantGroupRunnable

        public InstantGroupRunnable​(ScheduleableGroupAction target,
                                    boolean removeElementAfterAction)
        Constructor of InstantGroupRunnable.
        Parameters:
        target - The ScheduleableGroupAction interface to be run on the objects when there is time
        removeElementAfterAction - Whether to remove the elements after running the ScheduleableGroupAction on the objects
    • Method Detail

      • run

        public void run()
        Implements for TaskRunnable. Run the function of ScheduleableGroupAction on all the objects 1 by 1.
        Specified by:
        run in interface Runnable
        Overrides:
        run in class InstantRunnable
      • doGroupAction

        public void doGroupAction​(Object obj)
        The function to be run on the objects when there is time.
        Specified by:
        doGroupAction in interface ScheduleableGroupAction
        Parameters:
        obj - The object the function act on