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 |
addDependency(Task task)
|
| 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 |
getError()
|
| 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 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 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 |