PriorityFutureTask

public class PriorityFutureTask extends FutureTask<V>
implements Dependency<Task> PriorityProvider Task DelegateProvider

FutureTask that provides priority for PriorityThreadPoolExecutor Tries to cast runnable/callable to type that implements Dependency, PriorityProvider, and Task. This classes uses PriorityTask as default if cast cannot happen.

Public Constructor Summary

PriorityFutureTask(Callable<V> callable)
PriorityFutureTask(Runnable runnable, V result)

Public Method Summary

void
boolean
areDependenciesMet()
Returns true when the dependencies have been met
int
compareTo(Object another)
<T extends Dependency<Task> & PriorityProvider & Task> T
getDelegate()
Returns a delegate to be used when the parent class of the implementor can extend from a PriorityTask
Collection<Task>
getDependencies()
fulfilled before the Dependency instance.
Throwable
Priority
boolean
void
setError(Throwable throwable)
void
setFinished(boolean finished)
Marks Task as finished

Protected Method Summary

<T extends Dependency<Task> & PriorityProvider & Task> T
checkAndInitDelegate(Object object)

Inherited Method Summary

Public Constructors

public PriorityFutureTask (Callable<V> callable)

Parameters
callable

public PriorityFutureTask (Runnable runnable, V result)

Parameters
runnable
result

Public Methods

public void addDependency (Task task)

Parameters
task

public boolean areDependenciesMet ()

Returns true when the dependencies have been met

public int compareTo (Object another)

Parameters
another

public T getDelegate ()

Returns a delegate to be used when the parent class of the implementor can extend from a PriorityTask

public Collection<Task> getDependencies ()

fulfilled before the Dependency instance.

Returns
  • Collection of T to be fulfilled before the Dependency instance.

public Throwable getError ()

public Priority getPriority ()

public boolean isFinished ()

public void setError (Throwable throwable)

Parameters
throwable

public void setFinished (boolean finished)

Marks Task as finished

Parameters
finished

Protected Methods

protected T checkAndInitDelegate (Object object)

Parameters
object

Send feedback about...

Need help? Visit our support page.