public abstract class PriorityAsyncTask<Params,Progress,Result> extends AsyncTask<Params,Progress,Result> implements Dependency<Task>, PriorityProvider, Task, DelegateProvider
PriorityThreadPoolExecutor
AsyncTask.Status
SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR
Constructor and Description |
---|
PriorityAsyncTask() |
Modifier and Type | Method and Description |
---|---|
void |
addDependency(Task task)
Adds a
Dependency |
boolean |
areDependenciesMet()
Returns true when the dependencies have been met
|
int |
compareTo(Object another) |
void |
executeOnExecutor(ExecutorService exec,
Params... params) |
<T extends Dependency<Task> & PriorityProvider & Task> |
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 |
getPriority() |
boolean |
isFinished() |
void |
setError(Throwable throwable) |
void |
setFinished(boolean finished)
Marks Task as finished
|
cancel, doInBackground, execute, execute, executeOnExecutor, get, get, getStatus, init, isCancelled, onCancelled, onCancelled, onPostExecute, onPreExecute, onProgressUpdate, publishProgress, setDefaultExecutor
public final void executeOnExecutor(ExecutorService exec, Params... params)
public int compareTo(Object another)
compareTo
in interface Comparable
public void addDependency(Task task)
Dependency
addDependency
in interface Dependency<Task>
IllegalStateException
- if @{link Fabric} has not been initialized.public Collection<Task> getDependencies()
Dependency
getDependencies
in interface Dependency<Task>
public boolean areDependenciesMet()
Dependency
areDependenciesMet
in interface Dependency<Task>
public Priority getPriority()
getPriority
in interface PriorityProvider
Priority
for sorting purposespublic void setFinished(boolean finished)
Task
setFinished
in interface Task
public boolean isFinished()
isFinished
in interface Task
public void setError(Throwable throwable)
public Throwable getError()
public <T extends Dependency<Task> & PriorityProvider & Task> T getDelegate()
DelegateProvider
PriorityTask
getDelegate
in interface DelegateProvider