Class AbstractTask<V>

java.lang.Object
com.google.common.util.concurrent.internal.InternalFutureFailureAccess
com.google.common.util.concurrent.AbstractFuture<V>
com.sk89q.worldedit.util.task.AbstractTask<V>
Type Parameters:
V - the type returned
All Implemented Interfaces:
com.google.common.util.concurrent.ListenableFuture<V>, ProgressObservable, Task<V>, Future<V>
Direct Known Subclasses:
FutureForwardingTask

public abstract class AbstractTask<V> extends com.google.common.util.concurrent.AbstractFuture<V> implements Task<V>
An abstract task that stores a name and owner.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface java.util.concurrent.Future

    Future.State

    Nested classes/interfaces inherited from interface com.sk89q.worldedit.util.task.Task

    Task.State
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractTask(String name, Object owner)
    Create a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the time at which the task was created.
    Get the name of the task so it can be printed to the user.
    Get the owner of the task.
    Get the unique ID of this task.

    Methods inherited from class com.google.common.util.concurrent.AbstractFuture

    addListener, afterDone, cancel, get, get, interruptTask, isCancelled, isDone, pendingToString, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterrupted

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface java.util.concurrent.Future

    cancel, exceptionNow, get, get, isCancelled, isDone, resultNow, state

    Methods inherited from interface com.google.common.util.concurrent.ListenableFuture

    addListener

    Methods inherited from interface com.sk89q.worldedit.util.task.progress.ProgressObservable

    getProgress

    Methods inherited from interface com.sk89q.worldedit.util.task.Task

    getState
  • Constructor Details

    • AbstractTask

      protected AbstractTask(String name, @Nullable Object owner)
      Create a new instance.
      Parameters:
      name - the name
      owner - the owner
  • Method Details

    • getUniqueId

      public UUID getUniqueId()
      Description copied from interface: Task
      Get the unique ID of this task.
      Specified by:
      getUniqueId in interface Task<V>
      Returns:
      this task's unique ID
    • getName

      public String getName()
      Description copied from interface: Task
      Get the name of the task so it can be printed to the user.
      Specified by:
      getName in interface Task<V>
      Returns:
      the name of the task
    • getOwner

      @Nullable public Object getOwner()
      Description copied from interface: Task
      Get the owner of the task.
      Specified by:
      getOwner in interface Task<V>
      Returns:
      an owner object, if one is known or valid, otherwise null
    • getCreationDate

      public Date getCreationDate()
      Description copied from interface: Task
      Get the time at which the task was created.
      Specified by:
      getCreationDate in interface Task<V>
      Returns:
      a date