Package net.glowstone.scheduler
Class GlowTask
- All Implemented Interfaces:
Runnable,Future<Void>,RunnableFuture<Void>,org.bukkit.scheduler.BukkitTask,org.bukkit.scheduler.BukkitWorker
public class GlowTask
extends FutureTask<Void>
implements org.bukkit.scheduler.BukkitTask, org.bukkit.scheduler.BukkitWorker
Represents a task which is executed periodically.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Stops this task.protected voiddone()net.glowstone.scheduler.TaskExecutionStateThe last execution state returned byshouldExecute()(most likely the state the task is currently in).org.bukkit.plugin.PlugingetOwner()The Plugin that owns this task.intThe ID of this task.The thread this task has been last executed on, if this task is async.booleanisSync()A flag indicating whether this task is to be run asynchronously.voidrun()toString()Methods inherited from class java.util.concurrent.FutureTask
cancel, get, get, isCancelled, isDone, runAndReset, set, setExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.scheduler.BukkitTask
isCancelled
-
Constructor Details
-
GlowTask
public GlowTask(org.bukkit.plugin.Plugin owner, Runnable task, boolean sync, long delay, long period) Creates a new task with the specified number of ticks between consecutive calls to execute().- Parameters:
owner- The plugin which started the task.task- The runnable for this task.sync- If the task should be run synchronously.delay- The delay in ticks before running this task.period- The delay in ticks before running this task again. -1 for no repeat.
-
-
Method Details
-
toString
- Overrides:
toStringin classFutureTask<Void>
-
cancel
public void cancel()Stops this task.- Specified by:
cancelin interfaceorg.bukkit.scheduler.BukkitTask
-
run
public void run()- Specified by:
runin interfaceRunnable- Specified by:
runin interfaceRunnableFuture<Void>- Overrides:
runin classFutureTask<Void>
-
done
protected void done()- Overrides:
donein classFutureTask<Void>
-
getTaskId
public int getTaskId()The ID of this task.- Specified by:
getTaskIdin interfaceorg.bukkit.scheduler.BukkitTask- Specified by:
getTaskIdin interfaceorg.bukkit.scheduler.BukkitWorker
-
getOwner
public org.bukkit.plugin.Plugin getOwner()The Plugin that owns this task.- Specified by:
getOwnerin interfaceorg.bukkit.scheduler.BukkitTask- Specified by:
getOwnerin interfaceorg.bukkit.scheduler.BukkitWorker
-
isSync
public boolean isSync()A flag indicating whether this task is to be run asynchronously.- Specified by:
isSyncin interfaceorg.bukkit.scheduler.BukkitTask
-
getThread
The thread this task has been last executed on, if this task is async.- Specified by:
getThreadin interfaceorg.bukkit.scheduler.BukkitWorker
-
getLastExecutionState
public net.glowstone.scheduler.TaskExecutionState getLastExecutionState()The last execution state returned byshouldExecute()(most likely the state the task is currently in).
-