Class GlowTask

java.lang.Object
java.util.concurrent.FutureTask<Void>
net.glowstone.scheduler.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
    Constructor
    Description
    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().
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Stops this task.
    protected void
     
    net.glowstone.scheduler.TaskExecutionState
    The last execution state returned by shouldExecute() (most likely the state the task is currently in).
    org.bukkit.plugin.Plugin
    The Plugin that owns this task.
    int
    The ID of this task.
    The thread this task has been last executed on, if this task is async.
    boolean
    A flag indicating whether this task is to be run asynchronously.
    void
    run()
     
     

    Methods inherited from class java.util.concurrent.FutureTask

    cancel, get, get, isCancelled, isDone, runAndReset, set, setException

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods 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

      public String toString()
      Overrides:
      toString in class FutureTask<Void>
    • cancel

      public void cancel()
      Stops this task.
      Specified by:
      cancel in interface org.bukkit.scheduler.BukkitTask
    • run

      public void run()
      Specified by:
      run in interface Runnable
      Specified by:
      run in interface RunnableFuture<Void>
      Overrides:
      run in class FutureTask<Void>
    • done

      protected void done()
      Overrides:
      done in class FutureTask<Void>
    • getTaskId

      public int getTaskId()
      The ID of this task.
      Specified by:
      getTaskId in interface org.bukkit.scheduler.BukkitTask
      Specified by:
      getTaskId in interface org.bukkit.scheduler.BukkitWorker
    • getOwner

      public org.bukkit.plugin.Plugin getOwner()
      The Plugin that owns this task.
      Specified by:
      getOwner in interface org.bukkit.scheduler.BukkitTask
      Specified by:
      getOwner in interface org.bukkit.scheduler.BukkitWorker
    • isSync

      public boolean isSync()
      A flag indicating whether this task is to be run asynchronously.
      Specified by:
      isSync in interface org.bukkit.scheduler.BukkitTask
    • getThread

      public Thread getThread()
      The thread this task has been last executed on, if this task is async.
      Specified by:
      getThread in interface org.bukkit.scheduler.BukkitWorker
    • getLastExecutionState

      public net.glowstone.scheduler.TaskExecutionState getLastExecutionState()
      The last execution state returned by shouldExecute() (most likely the state the task is currently in).