Class QueuingSelfSchedulingTask<T>
java.lang.Object
de.eldoria.eldoutilities.threading.ReschedulingTask
de.eldoria.eldoutilities.scheduling.QueuingSelfSchedulingTask<T>
- Direct Known Subclasses:
DelayedActions
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final int -
Constructor Summary
ConstructorsConstructorDescriptionQueuingSelfSchedulingTask(org.bukkit.plugin.Plugin plugin) QueuingSelfSchedulingTask(org.bukkit.plugin.Plugin plugin, int maxIdleTicks, int maxDurationTarget) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all the queued objects and cancel the task.abstract voidhandle one object which was polled from the queueprotected booleanDefine if this object should be polled from queue or if the scheduler should proceed to the next tick.protected booleanprotected booleanfinal voidrun()protected final voidfinal voidshutdown()Shuts down the scheduler.voidtick()Tick is executed once per tick.
-
Field Details
-
DEFAULT_MAX_DURATION_TARGET
protected static final int DEFAULT_MAX_DURATION_TARGET- See Also:
-
DEFAULT_MAX_IDLE_TICKS
protected static final int DEFAULT_MAX_IDLE_TICKS- See Also:
-
-
Constructor Details
-
QueuingSelfSchedulingTask
public QueuingSelfSchedulingTask(org.bukkit.plugin.Plugin plugin, int maxIdleTicks, int maxDurationTarget) -
QueuingSelfSchedulingTask
public QueuingSelfSchedulingTask(org.bukkit.plugin.Plugin plugin)
-
-
Method Details
-
execute
handle one object which was polled from the queue- Parameters:
object- object from queue
-
tick
public void tick()Tick is executed once per tick. -
run
public final void run()- Specified by:
runin classReschedulingTask
-
proceed
Define if this object should be polled from queue or if the scheduler should proceed to the next tick.- Parameters:
object- object to check- Returns:
- true if the object should be handeld. false if the task should wait.
-
schedule
-
getQueueImplementation
-
shutdown
public final void shutdown()Description copied from class:ReschedulingTaskShuts down the scheduler. It can be not scheduled again after this.- Overrides:
shutdownin classReschedulingTask
-
clear
public void clear()Clear all the queued objects and cancel the task. It can be scheduled again after this. -
remove
-
removeIf
-